-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: shutdown sidero-controller-manager when any component fails
Fixes #560 The way it was implemented before this change, `errgoup` waits for all goroutines to finish before it returns, so if the controller crashes due to election issues, container still keeps running as HTTP API is up. After this change, container crashes on first error. Also added liveness/readiness check, they won't help much this issue, but provide additional layer of protection/visibility. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
- Loading branch information
Showing
3 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
package healthz | ||
|
||
import ( | ||
"net/http" | ||
) | ||
|
||
func RegisterServer(mux *http.ServeMux) error { | ||
mux.HandleFunc("/healthz", healthzHandler) | ||
|
||
return nil | ||
} | ||
|
||
func healthzHandler(w http.ResponseWriter, req *http.Request) { | ||
// do nothing, consider to be healthy always | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters