Skip to content

Commit f30a107

Browse files
committed
Remove use of deprecated framework.WaitForServiceEndpointsNum
1 parent f6ddf58 commit f30a107

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

vertical-pod-autoscaler/e2e/utils/webhook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
clientset "k8s.io/client-go/kubernetes"
3838
"k8s.io/kubernetes/test/e2e/framework"
3939
e2edeploy "k8s.io/kubernetes/test/e2e/framework/deployment"
40+
e2eendpointslice "k8s.io/kubernetes/test/e2e/framework/endpointslice"
4041
"k8s.io/utils/ptr"
4142
)
4243

@@ -373,7 +374,7 @@ func DeployWebhookAndService(f *framework.Framework, image string, certContext *
373374
framework.ExpectNoError(err, "creating service %s in namespace %s", WebhookServiceName, namespace)
374375

375376
ginkgo.By("Verifying the service has paired with the endpoint")
376-
err = framework.WaitForServiceEndpointsNum(context.TODO(), client, namespace, WebhookServiceName, 1, 1*time.Second, 30*time.Second)
377+
err = e2eendpointslice.WaitForEndpointCount(context.TODO(), client, namespace, WebhookServiceName, 1)
377378
framework.ExpectNoError(err, "waiting for service %s/%s have %d endpoint", namespace, WebhookServiceName, 1)
378379
}
379380

vertical-pod-autoscaler/e2e/v1/autoscaling_utils.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
clientset "k8s.io/client-go/kubernetes"
3535
"k8s.io/kubernetes/test/e2e/framework"
3636
e2edebug "k8s.io/kubernetes/test/e2e/framework/debug"
37+
e2eendpointslice "k8s.io/kubernetes/test/e2e/framework/endpointslice"
3738
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
3839
e2erc "k8s.io/kubernetes/test/e2e/framework/rc"
3940
"k8s.io/kubernetes/test/e2e/framework/resource"
@@ -54,11 +55,6 @@ const (
5455
port = 80
5556
targetPort = 8080
5657
timeoutRC = 120 * time.Second
57-
startServiceTimeout = time.Minute
58-
startServiceInterval = 5 * time.Second
59-
rcIsNil = "ERROR: replicationController = nil"
60-
deploymentIsNil = "ERROR: deployment = nil"
61-
rsIsNil = "ERROR: replicaset = nil"
6258
invalidKind = "ERROR: invalid workload kind for resource consumer"
6359
customMetricName = "QPS"
6460
serviceInitializationTimeout = 2 * time.Minute
@@ -420,8 +416,8 @@ func runServiceAndWorkloadForResourceConsumer(c clientset.Interface, ns, name st
420416
framework.ExpectNoError(e2erc.RunRC(context.TODO(), controllerRcConfig))
421417

422418
// Wait for endpoints to propagate for the controller service.
423-
framework.ExpectNoError(framework.WaitForServiceEndpointsNum(
424-
context.TODO(), c, ns, controllerName, 1, startServiceInterval, startServiceTimeout))
419+
framework.ExpectNoError(e2eendpointslice.WaitForEndpointCount(
420+
context.TODO(), c, ns, controllerName, 1))
425421
}
426422

427423
// runReplicaSet launches (and verifies correctness) of a replicaset.

0 commit comments

Comments
 (0)