mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
don't wait for first kubelet to be ready
and skip dummy deployment
This commit is contained in:
parent
b4c71b1f26
commit
89557110ed
@ -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{})
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user