Skip to content

Commit

Permalink
Merge pull request #1426 from dims/better-wait-for-the-control-plane-…
Browse files Browse the repository at this point in the history
…to-become-available

Better check to wait for the control-plane to become available
  • Loading branch information
k8s-ci-robot committed Sep 18, 2019
2 parents 9bb4967 + 862a0a4 commit 44491e4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ func NewFromDefaultSearchPath(kubeconfigFile string, overrides tcmd.ConfigOverri
if err := util.PollImmediate(retryAcquireClient, timeoutAcquireClient, func() (_ bool, err error) {
c, err = clientcmd.NewControllerRuntimeClient(kubeconfigFile, overrides)
if err != nil {
if strings.Contains(err.Error(), io.EOF.Error()) || strings.Contains(err.Error(), "refused") || strings.Contains(err.Error(), "no such host") {
// Connection was refused, probably because the API server is not ready yet.
klog.V(2).Infof("Waiting to acquire client... server not yet available: %v", err)
return false, nil
}
if strings.Contains(err.Error(), "unable to recognize") {
klog.V(2).Infof("Waiting to acquire client... api not yet available: %v", err)
return false, nil
}
klog.V(2).Infof("Waiting to acquire client...")
return false, err
}
Expand Down

0 comments on commit 44491e4

Please sign in to comment.