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

⚠️ Add OwnerReference to Kubeconfig secret #1403

Merged
merged 1 commit into from
Sep 9, 2019

Conversation

vincepri
Copy link
Member

@vincepri vincepri commented Sep 9, 2019

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 #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 9, 2019
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 9, 2019
@@ -216,6 +217,20 @@ func (r *ClusterReconciler) reconcileDelete(ctx context.Context, cluster *cluste
}
}

// Delete the Cluster's Kubeconfig Secret, if any.
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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>
@vincepri vincepri changed the title ✨ Remove kubeconfig secret on delete ⚠️ Add OwnerReference to Kubeconfig secret Sep 9, 2019
@k8s-ci-robot k8s-ci-robot removed the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 9, 2019
@vincepri vincepri changed the title ⚠️ Add OwnerReference to Kubeconfig secret ⚠️ Add OwnerReference to Kubeconfig secret Sep 9, 2019
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 9, 2019
@detiber
Copy link
Member

detiber commented Sep 9, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 9, 2019
@ncdc
Copy link
Contributor

ncdc commented Sep 9, 2019

Should we add a unit test?

@k8s-ci-robot k8s-ci-robot merged commit 6e40ca2 into kubernetes-sigs:master Sep 9, 2019
@vincepri
Copy link
Member Author

vincepri commented Sep 9, 2019

@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

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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.

None yet

4 participants