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

🐛 Trigger reconcile on Secret change #1322

Merged
merged 1 commit into from Aug 4, 2023

Conversation

zaneb
Copy link
Member

@zaneb zaneb commented Aug 4, 2023

The default meaning of the Owns() method in the controller-runtime controller is to only trigger reconciles on owner references where we have the 'controller' flag set.

We have never set the 'controller' flag on the networkData Secret used in both the BareMetalHost and PreprovisioningImage controllers.

Since #1164 we no longer set the 'controller' flag on our owner references for Secrets either, in order to allow the same BMC Secret to be shared amongst multiple hosts.

In each of these case we were either never or no longer triggering a reconcile when the Secret changed. Add the MatchEveryOwner option to ensure that we still trigger a reconcile even when the 'controller' flag is not set in the owner reference.

Fixes #1321

@metal3-io-bot metal3-io-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 4, 2023
@zaneb
Copy link
Member Author

zaneb commented Aug 4, 2023

/test-centos-e2e-integration-main
/test-ubuntu-integration-main

@zaneb
Copy link
Member Author

zaneb commented Aug 4, 2023

/cc @dtantsur

The default meaning of the Owns() method in the controller-runtime
controller is to only trigger reconciles on owner references where we have
the 'controller' flag set.

We have never set the 'controller' flag on the networkData Secret used
in both the BareMetalHost and PreprovisioningImage controllers.

Since 8550d61 we no longer set the
'controller' flag on our owner references for Secrets either, in order
to allow the same BMC Secret to be shared amongst multiple hosts.

In each of these case we were either never or no longer triggering a
reconcile when the Secret changed. Add the MatchEveryOwner option to
ensure that we still trigger a reconcile even when the 'controller' flag
is not set in the owner reference.
@zaneb
Copy link
Member Author

zaneb commented Aug 4, 2023

/test-centos-e2e-integration-main
/test-ubuntu-integration-main

@honza
Copy link
Member

honza commented Aug 4, 2023

/approve

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: honza

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 4, 2023
@dtantsur
Copy link
Member

dtantsur commented Aug 4, 2023

/lgtm

I wonder if we do need owner references, similar to BMC secrets...

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2023
@metal3-io-bot metal3-io-bot merged commit fca5977 into metal3-io:main Aug 4, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resources not reconciled when Secrets updated
4 participants