-
Notifications
You must be signed in to change notification settings - Fork 673
Description
Describe the bug
I am creating a pipeline which automatically updates FluxCD via a pull request. I was running into some permissions issues, in which I found that flux check
always returns with an exit code of 0 even if not all deployments were ready:
Note the first arrow points to the result of flux check --pre
which is as expected since it says all checks passed. The second arrow points to the result of flux check
which should return a non-zero status code since the checks failed.
Steps to reproduce
- Install Flux.
- Create a ServiceAccount missing some permissions required for
flux check
to run (reference What RBAC permissions are required for `flux check` to run successfully? #5217 (comment)). - Run
flux check
. - Run
echo $?
to see the status code.
Expected behavior
echo $?
should return a non-zero status code if the result is "check failed".
Screenshots and recordings
No response
OS / Distro
Ubuntu 22.04
Flux version
v2.5.1
Flux check
► checking prerequisites
✔ Kubernetes 1.31.1 >=1.30.0-0
► checking version in cluster
✔ distribution: flux-v2.4.0
✔ bootstrapped: true
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v1.1.0
✔ image-automation-controller: deployment ready
► ghcr.io/fluxcd/image-automation-controller:v0.39.0
✔ image-reflector-controller: deployment ready
► ghcr.io/fluxcd/image-reflector-controller:v0.33.0
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v1.4.0
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v1.4.0
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v1.4.1
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta3
✔ buckets.source.toolkit.fluxcd.io/v1
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1
✔ helmreleases.helm.toolkit.fluxcd.io/v2
✔ helmrepositories.source.toolkit.fluxcd.io/v1
✔ imagepolicies.image.toolkit.fluxcd.io/v1beta2
✔ imagerepositories.image.toolkit.fluxcd.io/v1beta2
✔ imageupdateautomations.image.toolkit.fluxcd.io/v1beta2
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta3
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed
Git provider
No response
Container Registry provider
No response
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct