Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check readiness of Flux kinds using kstatus #4311

Merged
merged 1 commit into from Dec 8, 2023
Merged

Conversation

darkowlzz
Copy link
Contributor

@darkowlzz darkowlzz commented Oct 9, 2023

While trying to answer and verify the concerns of this discussion fluxcd/notification-controller#540 (comment) about static/statusless objects and their compatibility with kstatus, and also to make #4298 CLI readiness check of static objects, easier and better, I found that all the readiness checks in CLI can be simplified by using kstatus itself and we no longer need to question if our API works with kstatus or not. With this change, all the readiness checks in the CLI will be performed using kstatus. If any of the Flux API objects break kstatus compatibility, they won't work with the CLI. Making it easier to answer what's kstatus compatible and not.

This change replaces all the many functions and ways of calculating readiness of objects into one unified way that uses kstatus.Compute() to check if the object is in progress or current. Only the objects that are current are considered to be ready. This takes advantage of the kstatus compatibility of Flux's APIs and also makes sure that they remain kstatus compatible.

The new isObjectReady() function is also aware of static/statusless objects and knows how to check their readiness using kstatus. This prepares the CLI for the upcoming static API objects.

All the is*Ready() functions for specific objects have been removed.

This change doesn't affect any of the existing e2e test results.

Introduce suspend and resume subcommands for alert-provider. This was needed to fully implement the reconcilable interface for alert-provider in order to use the new common readiness check.

flux2 GCP e2e test run with these changes https://github.com/fluxcd/flux2/actions/runs/7031238401/job/19132415957.

go.mod Outdated Show resolved Hide resolved
@darkowlzz darkowlzz force-pushed the kstatus-readiness branch 2 times, most recently from cd61094 to 720396c Compare December 8, 2023 13:38
This change replaces all the many functions and ways of calculating
readiness of objects into one unified way that uses kstatus.Compute() to
check if the object is in progress or current. Only the objects that are
current are considered to be ready. This takes advantage of the kstatus
compatibility of Flux's APIs and also makes sure that they remain
kstatus compatible.

The new isObjectReady() function is also aware of static/statusless
objects and knows how to check their readiness using kstatus. This
prepares the CLI for the upcoming static API objects.

All the is*Ready() functions for specific objects have been removed.

This change doesn't affect any of the existing tests results.

Introduce suspend and resume subcommands for alert-provider.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
@hiddeco hiddeco changed the title check readiness using kstatus Check readiness of Flux objects using kstatus Dec 8, 2023
@hiddeco hiddeco changed the title Check readiness of Flux objects using kstatus Check readiness of Flux kinds using kstatus Dec 8, 2023
@darkowlzz darkowlzz merged commit 6135c32 into main Dec 8, 2023
8 checks passed
@darkowlzz darkowlzz deleted the kstatus-readiness branch December 8, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants