From b4f1777e651dd41419250fbf8798f72deeaec41b Mon Sep 17 00:00:00 2001 From: Brandon Wagner Date: Tue, 11 Oct 2022 16:51:11 -0500 Subject: [PATCH] remove sleeps (#2104) --- pkg/k8sapi/k8sutils.go | 2 +- scripts/entrypoint.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/k8sapi/k8sutils.go b/pkg/k8sapi/k8sutils.go index 6f119ede23..a2c8e57021 100644 --- a/pkg/k8sapi/k8sutils.go +++ b/pkg/k8sapi/k8sutils.go @@ -115,7 +115,7 @@ func CheckAPIServerConnectivity() error { log.Infof("Testing communication with server") // Reconcile the API server query after waiting for a second, as the request // times out in one second if it fails to connect to the server - return wait.PollInfinite(2*time.Second, func() (bool, error) { + return wait.PollImmediateInfinite(2*time.Second, func() (bool, error) { version, err := clientSet.Discovery().ServerVersion() if err != nil { // When times out return no error, so the PollInfinite will retry with the given interval diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 40a2aeb37b..59b12640b3 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -128,8 +128,6 @@ wait_for_ipam() { if ./grpc-health-probe -addr 127.0.0.1:50051 >/dev/null 2>&1; then return 0 fi - # We sleep for 1 second between each retry - sleep 1 log_in_json info "Retrying waiting for IPAM-D" done }