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

fix(watches): update object types watched by controller #468

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

ebaron
Copy link
Member

@ebaron ebaron commented Oct 7, 2022

This updates the kinds of objects that the controller watches to ensure that any change to an owned object triggers a reconcile. The cert-manager APIs pose a slight complication since if the resource types do not exist in the Kubernetes API server, the controller will fail to start.

I modified the OpenShift detection logic to also test for cert-manager. Unfortunately, there's no way yet to dynamically update the list of watched object types (kubernetes-sigs/controller-runtime#1884). This means that if the user installs cert-manager after the controller has started, they will have to redeploy the operator to pick up that change.

I changed the setup from using the Watches method to the newer Owns which is recommended for this purpose.

Fixes: #415

@ebaron ebaron marked this pull request as ready for review October 11, 2022 19:46
Copy link
Member

@tthvo tthvo left a comment

Choose a reason for hiding this comment

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

Looks good to me! I did some edits on owned objects and the reconciler is called as expected :D

@ebaron ebaron merged commit 96170b9 into cryostatio:main Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Update list of watched objects
2 participants