Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better check to wait for the control-plane to become available #1426

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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