@@ -47,16 +47,15 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
4747})
4848
4949By ("verifying AWS loadbalancer resources" , func () {
50- nodeList := & corev1.NodeList {}
51- err := tf .K8sClient .List (ctx , nodeList )
50+ nodeList , err := stack .GetWorkerNodes (ctx , tf )
5251Expect (err ).ToNot (HaveOccurred ())
5352err = verifyAWSLoadBalancerResources (ctx , tf , lbARN , LoadBalancerExpectation {
5453Type : "network" ,
5554Scheme : "internet-facing" ,
5655TargetType : "instance" ,
5756Listeners : stack .resourceStack .getListenersPortMap (),
5857TargetGroups : stack .resourceStack .getTargetGroupNodePortMap (),
59- NumTargets : len (nodeList . Items ),
58+ NumTargets : len (nodeList ),
6059TargetGroupHC : & TargetGroupHC {
6160Protocol : "TCP" ,
6261Port : "traffic-port" ,
@@ -69,10 +68,9 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
6968Expect (err ).NotTo (HaveOccurred ())
7069})
7170By ("waiting for target group targets to be healthy" , func () {
72- nodeList := & corev1.NodeList {}
73- err := tf .K8sClient .List (ctx , nodeList )
71+ nodeList , err := stack .GetWorkerNodes (ctx , tf )
7472Expect (err ).ToNot (HaveOccurred ())
75- err = waitUntilTargetsAreHealthy (ctx , tf , lbARN , len (nodeList . Items ))
73+ err = waitUntilTargetsAreHealthy (ctx , tf , lbARN , len (nodeList ))
7674Expect (err ).NotTo (HaveOccurred ())
7775})
7876By ("waiting until DNS name is available" , func () {
@@ -174,16 +172,15 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
174172Expect (lbARN ).ToNot (BeEmpty ())
175173})
176174By ("verifying AWS loadbalancer resources" , func () {
177- nodeList := & corev1.NodeList {}
178- err := tf .K8sClient .List (ctx , nodeList )
175+ nodeList , err := stack .GetWorkerNodes (ctx , tf )
179176Expect (err ).ToNot (HaveOccurred ())
180177err = verifyAWSLoadBalancerResources (ctx , tf , lbARN , LoadBalancerExpectation {
181178Type : "network" ,
182179Scheme : "internal" ,
183180TargetType : "instance" ,
184181Listeners : stack .resourceStack .getListenersPortMap (),
185182TargetGroups : stack .resourceStack .getTargetGroupNodePortMap (),
186- NumTargets : len (nodeList . Items ),
183+ NumTargets : len (nodeList ),
187184TargetGroupHC : & TargetGroupHC {
188185Protocol : "TCP" ,
189186Port : "traffic-port" ,
0 commit comments