From 16dcace669bdef9174edb13e59c09c9d805a4f31 Mon Sep 17 00:00:00 2001
From: Tim Reddehase
Date: Sun, 3 Feb 2019 16:53:38 +0100
Subject: [PATCH] do not wait for endpoints that shouldn't exist
If there are no replicas defined, do not wait
around for the respective endpoints, since none
are expected.
---
test/e2e/framework/k8s.go | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/e2e/framework/k8s.go b/test/e2e/framework/k8s.go
index 2833e8694..f9e4425be 100644
--- a/test/e2e/framework/k8s.go
+++ b/test/e2e/framework/k8s.go
@@ -144,6 +144,9 @@ func WaitForPodsReady(kubeClientSet kubernetes.Interface, timeout time.Duration,
// WaitForEndpoints waits for a given amount of time until an endpoint contains.
func WaitForEndpoints(kubeClientSet kubernetes.Interface, timeout time.Duration, name, ns string, expectedEndpoints int) error {
+ if expectedEndpoints == 0 {
+ return nil
+ }
return wait.Poll(2*time.Second, timeout, func() (bool, error) {
endpoint, err := kubeClientSet.CoreV1().Endpoints(ns).Get(name, metav1.GetOptions{})
if k8sErrors.IsNotFound(err) {