Add taint to supervisor
This commit is contained in:
parent
e07752d65a
commit
50b487bf5f
|
@ -117,6 +117,14 @@ func (sv *supervisor) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Error(w, "401 wrong access token", http.StatusUnauthorized)
|
http.Error(w, "401 wrong access token", http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if r.URL.Path == "/api/supervisor/v1/taint" {
|
||||||
|
if r.Method != http.MethodPost {
|
||||||
|
http.Error(w, "405 method not allowed", http.StatusMethodNotAllowed)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sv.deployConfigHash = "tainted"
|
||||||
|
return
|
||||||
|
}
|
||||||
if r.URL.Path == "/api/supervisor/v1/reload" {
|
if r.URL.Path == "/api/supervisor/v1/reload" {
|
||||||
if r.Method != http.MethodPost {
|
if r.Method != http.MethodPost {
|
||||||
http.Error(w, "405 method not allowed", http.StatusMethodNotAllowed)
|
http.Error(w, "405 method not allowed", http.StatusMethodNotAllowed)
|
||||||
|
@ -322,6 +330,7 @@ func (sv *supervisor) reload() error {
|
||||||
deployCfgHash := fmt.Sprintf("%x", h.Sum(nil))
|
deployCfgHash := fmt.Sprintf("%x", h.Sum(nil))
|
||||||
if deployCfgHash == sv.deployConfigHash {
|
if deployCfgHash == sv.deployConfigHash {
|
||||||
sv.status(fmt.Sprintf("config hash remains at %s", deployCfgHash))
|
sv.status(fmt.Sprintf("config hash remains at %s", deployCfgHash))
|
||||||
|
return nil
|
||||||
} else {
|
} else {
|
||||||
sv.status(fmt.Sprintf(
|
sv.status(fmt.Sprintf(
|
||||||
"config hash updated %s => %s",
|
"config hash updated %s => %s",
|
||||||
|
|
Loading…
Reference in New Issue