mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-08 00:37:27 +00:00
check: exit 1 on control plane failed checks
This commit is contained in:
parent
aedff58f98
commit
0f99f313a0
1 changed files with 3 additions and 1 deletions
|
|
@ -202,14 +202,16 @@ func componentsCheck() bool {
|
|||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
|
||||
ok := true
|
||||
for _, deployment := range components {
|
||||
command := fmt.Sprintf("kubectl -n %s rollout status deployment %s --timeout=%s",
|
||||
namespace, deployment, timeout.String())
|
||||
if output, err := utils.execCommand(ctx, ModeCapture, command); err != nil {
|
||||
logFailure("%s: %s", deployment, strings.TrimSuffix(output, "\n"))
|
||||
ok = false
|
||||
} else {
|
||||
logSuccess("%s is healthy", deployment)
|
||||
}
|
||||
}
|
||||
return true
|
||||
return ok
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue