Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

A cluster-scoped controller cannot update or delete namespaced resources #127

Closed
silverlyra opened this issue Jan 12, 2019 · 0 comments
Closed
Assignees

Comments

@silverlyra
Copy link
Contributor

I'm writing a cluster-scoped CompositeController that sometimes needs to create Pods, which are of course namespaced.

I don't think the support for this in Metacontroller is working. When my controller omits a Pod it had created from the children it returns, metacontroller can't delete it, and logs an error on every reconcile:

can't reconcile children for <the custom resource>: can't delete Pod <ns>/<name>: the server could not find the requested resource

I'm guessing that ManageChildren's deleteChildren helper chokes on the namespace/name keys Metacontroller generates for namespace-scoped children with a cluster-scoped parent:

for name, obj := range observed {
	if desired == nil || desired[name] == nil {
		err := client.Namespace(obj.GetNamespace()).Delete(name, …)
	}
}

If name here is really "namespace/name", that's not going to work. It looks like updateChildren is affected as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants