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

feat: check dependency for state of the world reconciler #870

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

KevFan
Copy link
Contributor

@KevFan KevFan commented Sep 24, 2024

Description

Closes: #811

Checks for dependencies for whether specific watchers and object kinds should be added to the controller opts of the state of the world reconciler

Comment on lines +91 to +93
// TODO: add object links
)
// TODO: add specific tasks to workflow
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Future TODOs that would be completed by other issues as functionality is migrated to the workflow

@KevFan KevFan self-assigned this Sep 25, 2024
@KevFan KevFan added kind/enhancement New feature or request size/small labels Sep 25, 2024
@KevFan KevFan marked this pull request as ready for review September 25, 2024 11:07
@KevFan KevFan requested review from guicassolato and Boomatang and removed request for guicassolato September 25, 2024 11:07
Copy link
Contributor

@Boomatang Boomatang left a comment

Choose a reason for hiding this comment

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

Have yet to run it but wanted to ask about what happens if there is not gateways first.

Also I know you have the to do's marked in. So I guess the linking functions would be the next step.

@@ -59,6 +64,71 @@ func NewPolicyMachineryController(manager ctrlruntime.Manager, client *dynamic.D
controller.WithReconcile(buildReconciler(client)),
}

ok, err := kuadrantgatewayapi.IsGatewayAPIInstalled(manager.GetRESTMapper())
Copy link
Contributor

Choose a reason for hiding this comment

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

What should happen if there is no gateway currently installed that we can use? We would need at least one, I am asking the same question of the cert manger if that is not installed should we try reconcile. I am aware that the user may install these resources later, but that would mean restarting the operator (which I am okay with).

I guess my question is; should we even start the operator if there is no gateway that we can use installed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, not sure what's the best approach but I've went with the approach of the existing controllers which gets disabled rather than crash when a dependency CRD is not detected (which we have existing integration tests for) 🤔

Personally, I think it's better not to crash and have this reported in the Policy Status also since a user may not initially look through logs on why things are not working as expected.

Copy link
Contributor

@eguzki eguzki Sep 26, 2024

Choose a reason for hiding this comment

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

I agree, the operator should not crash. Personally, for now, what I would do is to disable watchers and maybe steps in the workflow. There should be a task responsible for the kuadrant CR status that watches for changes on Kuadrant CRDs (which we can assume they exist). Then, the task checks for GatewayAPI being installed and reports in the status if not. Same for policies.

Copy link
Contributor

Choose a reason for hiding this comment

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

After the call I am happy that we have a plan to get the errors these missing CRDs and resources can cause into the status of kuadrant and / or the related policies. Would be good to create issue for any follow up work this may need.

@eguzki
Copy link
Contributor

eguzki commented Sep 26, 2024

LGTM

I leave approval to @Boomatang

@KevFan KevFan merged commit 1985a16 into Kuadrant:main Sep 27, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request size/small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[state-of-the-world reconciler] Dependency check
3 participants