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.
This commit is contained in:
parent
018a1e4d94
commit
16dcace669
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue