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

Automated cherry pick of #43835 release 1.6 #43837

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 2 additions & 11 deletions cmd/kubeadm/app/master/apiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func CreateClientAndWaitForAPI(file string) (*clientset.Clientset, error) {
fmt.Println("[apiclient] Created API client, waiting for the control plane to become ready")
WaitForAPI(client)

fmt.Println("[apiclient] Waiting for at least one node to register and become ready")
fmt.Println("[apiclient] Waiting for at least one node to register")
start := time.Now()
wait.PollInfinite(kubeadmconstants.APICallRetryInterval, func() (bool, error) {
nodeList, err := client.Nodes().List(metav1.ListOptions{})
Expand All @@ -55,20 +55,11 @@ func CreateClientAndWaitForAPI(file string) (*clientset.Clientset, error) {
if len(nodeList.Items) < 1 {
return false, nil
}
n := &nodeList.Items[0]
if !v1.IsNodeReady(n) {
fmt.Println("[apiclient] First node has registered, but is not ready yet")
return false, nil
}

fmt.Printf("[apiclient] First node is ready after %f seconds\n", time.Since(start).Seconds())
fmt.Printf("[apiclient] First node has registered after %f seconds\n", time.Since(start).Seconds())
return true, nil
})

if err := createAndWaitForADummyDeployment(client); err != nil {
return nil, err
}

return client, nil
}

Expand Down