-
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 OwnerReference to Kubeconfig secret #1403
⚠️ Add OwnerReference to Kubeconfig secret #1403
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
controllers/cluster_controller.go
Outdated
@@ -216,6 +217,20 @@ func (r *ClusterReconciler) reconcileDelete(ctx context.Context, cluster *cluste | |||
} | |||
} | |||
|
|||
// Delete the Cluster's Kubeconfig Secret, if any. |
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.
If there is an OwnerReference, this shouldn't be needed.
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.
We don't set one today, should we?
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.
We should be adding the OwnerRef when we create, and if someone is providing a pre-existing kubeconfig secret, then we should likely not assume that we can delete it for them.
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.
Changed it up to add the owner ref
Signed-off-by: Vince Prignano <vincepri@vmware.com>
01c36ec
to
8723cca
Compare
/lgtm |
Should we add a unit test? |
@ncdc I might need to follow-up with a clusterctl fix as well to remove the OwnerRef if it's a cluster one, I'll look into it later today |
Signed-off-by: Vince Prignano vincepri@vmware.com
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #