mirror of https://github.com/kubernetes/kops.git
use http.StatusConflict
This commit is contained in:
parent
8e6199fa39
commit
a765191898
|
@ -144,7 +144,7 @@ func (s *Server) bootstrap(w http.ResponseWriter, r *http.Request) {
|
|||
if err != nil {
|
||||
// means that we should exit nodeup gracefully
|
||||
if err == bootstrap.ErrAlreadyExists {
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
w.WriteHeader(http.StatusConflict)
|
||||
klog.Infof("%s: %v", r.RemoteAddr, err)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -151,8 +151,8 @@ func (b *Client) Query(ctx context.Context, req any, resp any) error {
|
|||
defer response.Body.Close()
|
||||
}
|
||||
|
||||
// if we receive StatusNoContent it means that we should exit gracefully
|
||||
if response.StatusCode == http.StatusNoContent {
|
||||
// if we receive StatusConflict it means that we should exit gracefully
|
||||
if response.StatusCode == http.StatusConflict {
|
||||
klog.Infof("kops-controller returned status code %d", response.StatusCode)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue