Check Flux source code for status
Why
We want to look into Flux codebase and see what the possible statuses for Flux resources because we need to map their status to a UI dashboard concept of "last synced" and "last synced status" (see Fetch and render cluster sync badges on environ... (#391581 - closed) for more details).
What
- check out the Flux source code and find possible relevant statuses.
- work with @anna_vovchenko to see how the possible status might be mapped to what we're trying to show in the dashboard
Related reading
- https://github.com/fluxcd/pkg/blob/main/apis/meta/conditions.go
- https://github.com/fluxcd/source-controller/blob/6901379b7353048e53f4d3cb0a3dd4e1f2ad8bd9/api/v1/gitrepository_types.go#L179
- https://github.com/kubernetes-sigs/cli-utils/blob/v0.25.0/pkg/kstatus/README.md#conditions
Results
Status | Conditions | Badge | Tooltip |
---|---|---|---|
Failed | at least one { type: Ready, status: "False" }
|
conditions.message provided by Flux |
|
Stalled | no failed, at least one { type: Stalled, status: "True" }
|
conditions.message provided by Flux |
|
Reconciling | no failed, stalled, at least one { type: Reconciling, status: "True" }
|
- | |
Reconciled | no failed, no stalled, no reconciling, at least one { type: Ready, status: "True" }
|
- | |
Unknown | other combinations | Unable to detect state. Read more about how states are detected. | |
Unavailable | no Kustomizations or HelmReleases found | Sync status is unknown. See the tutorial to learn more about the Flux approach. | |
Unavailable | Kustomizations or HelmReleases query errored | Error message provided by KAS |
Useful resources
- Discussion with the Flux team: https://github.com/fluxcd/flux2/discussions/4107
- Kustomize controller logic: https://github.com/fluxcd/kustomize-controller/blob/main/internal/controller/suite_test.go#L200-L226
- Conditions logic: https://github.com/fluxcd/pkg/blob/2a323d771e17af02dee2ccbbb9b445b78ab048e5/runtime/conditions/getter.go#L96-L112
Edited by Anna Vovchenko