func (w *KubeWaiter) WaitForAPI() error {
	start := time.Now()
	return wait.PollImmediate(kubeadmconstants.APICallRetryInterval, w.timeout, func() (bool, error) {
		healthStatus := 0
		w.client.Discovery().RESTClient().Get().AbsPath("/healthz").Do(context.TODO()).StatusCode(&healthStatus)
		if healthStatus != http.StatusOK {
			return false, nil
		}

		fmt.Printf("[apiclient] All control plane components are healthy after %f seconds\n", time.Since(start).Seconds())
		return true, nil
	})
}
// WaitForAPI waits for the API Server's /healthz endpoint to report "ok"
WaitForAPI waits for the API Server's /healthz endpoint to report "ok"
// WaitForAPI waits for the API Server ' s / healthz endpoint to report " ok "
func (w *KubeWaiter) WaitForAPI() error {
	start := time.Now()
	return wait.PollImmediate(kubeadmconstants.APICallRetryInterval, w.timeout, func() (bool, error) {
		healthStatus := 0
		w.client.Discovery().RESTClient().Get().AbsPath("/healthz").Do(context.TODO()).StatusCode(&healthStatus)
		if healthStatus != http.StatusOK {
			return false, nil
		}
		fmt.Printf("[apiclient] All control plane components are healthy after %f seconds\n", time.Since(start).Seconds())
		return true, nil
	})
}
func ( w * KubeWaiter ) WaitForAPI ( ) error { start := time . Now ( ) return wait . PollImmediate ( kubeadmconstants . APICallRetryInterval , w . timeout , func ( ) ( bool , error ) { healthStatus := 0 w . client . Discovery ( ) . RESTClient ( ) . Get ( ) . AbsPath ( " " ) . Do ( context . TODO ( ) ) . StatusCode ( & healthStatus ) if healthStatus != http . StatusOK { return false , nil } fmt . Printf ( " \n " , time . Since ( start ) . Seconds ( ) ) return true , nil } ) }
WaitForAPI waits for the API Server's /healthz endpoint to report "ok"
WaitForAPI waits for the API Server ' s / healthz endpoint to report " ok "