-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 OwnerRef to clusterResourceSetBinding on each reconcile #6989
🐛 Add OwnerRef to clusterResourceSetBinding on each reconcile #6989
Conversation
@@ -264,6 +264,9 @@ func (r *ClusterResourceSetReconciler) ApplyClusterResourceSet(ctx context.Conte | |||
} | |||
}() | |||
|
|||
// Ensure that the owner references are set on the ClusterResourceSetBinding. | |||
clusterResourceSetBinding.OwnerReferences = ensureOwnerRefs(clusterResourceSetBinding, clusterResourceSet, cluster) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this is done in the ClusterResourceSet reconcile rather than the ClusterResourceSetBinding reconcile. This may cause some slight drift in setting the owner references.
The main case we care about is backup -> restore -> deletion so the drift of a couple of minutes should be acceptable. In the normal case we'd expect these owner references to be applied on the first reconcile of the ClusterResourceSet i.e. right after restore + unpause.
/kind bug |
4f4e23d
to
73cacfd
Compare
@@ -100,6 +100,14 @@ func (c *ClusterResourceSetBinding) DeleteBinding(clusterResourceSet *ClusterRes | |||
break | |||
} | |||
} | |||
// Remove the ClusterResourceSet from the ClusterResourceSetBinding OwnerReferences. | |||
for i, ownerRef := range c.OwnerReferences { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously we weren't updating ownerReferences at all after creation so the initial ClusterResourceSet was always an owner even if it had been deleted.
overall lgtm, thanks for tackling this |
73cacfd
to
8737a55
Compare
/cherry-pick release-1.2 |
@vincepri: once the present PR merges, I will cherry-pick it on top of release-1.2 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
8737a55
to
96c71f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
96c71f5
to
f152444
Compare
Signed-off-by: killianmuldoon <[email protected]>
f152444
to
daf21c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
@vincepri: new pull request created: #7012 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: killianmuldoon [email protected]
Fix an issue where OwnerReferences were only added to a ClusterResourceSetBinding on Create. This fix will ensure the references are set each time the ClusterResourceSet the Binding is created from from is reconciled.
Fixes #6007