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

Add support for HelmRepo OCI and NC v1beta3 static objects #4298

Merged
merged 3 commits into from Dec 8, 2023

Conversation

darkowlzz
Copy link
Contributor

@darkowlzz darkowlzz commented Oct 4, 2023

Depends on fluxcd/notification-controller#540 and fluxcd/source-controller#1243 that make HelmRepository OCI, Alert and Provider static objects.

This change makes the CLI aware of static objects. Static objects don't have status to report readiness. The CLI shows them as ready always.

fluxcd/source-controller#1243 makes HelmRepository OCI static. CLI shows it as ready:

$ flux -n default get sources helm example 
NAME    REVISION        SUSPENDED       READY   MESSAGE                  
example                 False           True    Helm repository is Ready

$ flux -n default get alerts default-alerts 
NAME            SUSPENDED       READY   MESSAGE        
default-alerts  False           True    Alert is Ready

$ flux -n default get alert-providers slack-test 
NAME            READY   MESSAGE           
slack-test      True    Provider is Ready

The static objects also don't support reconciliation. The CLI prints that the objects don't support reconciliation.

$ flux -n default reconcile source helm example 
✔ reconciliation not supported by the object

alert and alert-provider subcommands for reconcile have been removed as they are completely static objects in Alert and Provider v1beta3 API.

Update all the references of NC v1beta2 API to v1beta3 and updates the tests accordingly.

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

@darkowlzz darkowlzz changed the base branch from main to kstatus-readiness October 13, 2023 20:45
@darkowlzz darkowlzz force-pushed the kstatus-readiness branch 2 times, most recently from 25a8559 to c75cdc3 Compare October 17, 2023 12:38
@darkowlzz darkowlzz marked this pull request as ready for review November 28, 2023 11:17
@darkowlzz darkowlzz changed the title non-reconciliable & readiness of static objects non-reconciliable & readiness of static objects with v1beta3 NC Nov 28, 2023
tests/azure/go.mod Outdated Show resolved Hide resolved
tests/integration/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
@darkowlzz darkowlzz force-pushed the no-reconcile-ready-static branch 4 times, most recently from 8265de6 to b7ff3eb Compare December 8, 2023 14:14
@darkowlzz darkowlzz force-pushed the no-reconcile-ready-static branch 2 times, most recently from 936db5f to 56e035d Compare December 8, 2023 14:40
Base automatically changed from kstatus-readiness to main December 8, 2023 14:59
@darkowlzz darkowlzz force-pushed the no-reconcile-ready-static branch 2 times, most recently from a1bc966 to 7b904f6 Compare December 8, 2023 15:15
cmd/flux/reconcile.go Outdated Show resolved Hide resolved
Remove reconcile subcommand for static object APIs Alerts and Providers.

Add a isStatic() method on all the object adapters to determine if
they are static and don't have reconciler. The objects that don't
have reconcilers are skipped from reconciliation and readiness
checks like HelmRepository of type OCI.

Add default ready message for `get` subcommand output for static
objects, Alerts, Providers and HelmRepositories of type OCI, as ready
message can't be derived for them from their status.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
Signed-off-by: Sunny <darkowlzz@protonmail.com>
HelmRepo OCI, Alerts and Providers are static objects and don't need to
be checked for readiness.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
@darkowlzz darkowlzz changed the title non-reconciliable & readiness of static objects with v1beta3 NC Add support for HelmRepo OCI and NC v1beta3 static objects Dec 8, 2023
Copy link
Member

@aryan9600 aryan9600 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@darkowlzz darkowlzz merged commit 0e7dedc into main Dec 8, 2023
11 checks passed
@darkowlzz darkowlzz deleted the no-reconcile-ready-static branch December 8, 2023 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants