mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
don't start controllers against unhealthy master
This commit is contained in:
parent
b617cabfca
commit
0a2cd24f9d
@ -331,6 +331,13 @@ func getAvailableResources(clientBuilder controller.ControllerClientBuilder) (ma
|
|||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
healthStatus := 0
|
||||||
|
client.Discovery().RESTClient().Get().AbsPath("/healthz").Do().StatusCode(&healthStatus)
|
||||||
|
if healthStatus != http.StatusOK {
|
||||||
|
glog.Errorf("Server isn't healthy yet. Waiting a little while.")
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
discoveryClient = client.Discovery()
|
discoveryClient = client.Discovery()
|
||||||
return true, nil
|
return true, nil
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user