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

Do not set ownership for x-namespaced resources #1548

Merged
merged 1 commit into from
Jun 4, 2020

Conversation

zen-dog
Copy link
Contributor

@zen-dog zen-dog commented Jun 3, 2020

Summary:
Previously we used a custom setControllerReference method which would simply ignore x-namespaced resources thus potentially leaving dangling resources after the Instance was deleted. This PR removes the method in favor of controller-runtime namespace ownership validation which returns an error should an Instance try to deploy a x-namespaced resource. Note, that cluster-scoped resources (e.g. v1/Namespace etc.) would still work.

Signed-off-by: Aleksey Dukhovniy alex.dukhovniy@googlemail.com

Summary:
`controller-runtime` already does the [namespace checking](https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/controller/controllerutil/controllerutil.go#L144) which was presumably not always the case (and why we had to implement our own)

Signed-off-by: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
@zen-dog zen-dog changed the title Remove duplicated setControllerReference method Remove obsolete setControllerReference method Jun 3, 2020
Copy link
Member

@porridge porridge left a comment

Choose a reason for hiding this comment

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

It is very interesting that @alenkacz added this method in the very same PR where she bumped KUDO to controller-runtime v0.4.0 which is exactly the release where a nearly identical check was added to the upstream SetControllerReference.

Do they somehow differ in a way that I'm not seeing?

Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

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

/lgtm

@kensipe kensipe merged commit 8841203 into master Jun 4, 2020
@kensipe kensipe deleted the ad/controller-reference branch June 4, 2020 13:42
@alenkacz
Copy link
Contributor

alenkacz commented Jun 4, 2020

@zen-dog zen-dog added the release/breaking-change This PR contains breaking changes and is marked in the release notes label Jun 4, 2020
@zen-dog zen-dog changed the title Remove obsolete setControllerReference method Do not set ownership for x-namespaced resources Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/breaking-change This PR contains breaking changes and is marked in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants