-
Notifications
You must be signed in to change notification settings - Fork 79
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
Bug: implicit namespace resolution in apply-time-mutation causes dependency sorting failure #481
Comments
Explicit dep with depends-on works, so it's just apply-time-mutation that doesn't (weird!).
|
apply-time-mutation works if the source namespace is specified. So it's just the implicit namespace resolution that breaks graph sorting. |
Root cause: Unfortunately, the easy solution of moving implicit namespace resolution into So this is another issue with mapping lookups happening up front instead of lazily as-needed. Changing that, to resolve sort order after every apply, would be a significant change... Also unfortunate is that we can't reject SourceRefs without an explicit namespace without knowing if the resource is namespaced or not... |
Possible workarounds:
|
Today, all the namespaced objects sent from Config Sync to cli-utils have the |
cli-utils already requires this. This problem here is with apply-time-mutation annotations which were initially designed to support inferring the namespace of dependencies from the namespace of the dependent object. However, it does look like disabling implicit namespace resolution for apply-time-mutation is the easier path forward, and would align with the requirement on the objects themselves. |
I don't think this is true. I tested with |
The Applier runs the Valdator which runs the The valdiator should error if it's namespace-scoped with no namespace or cluster-scoped with a namespace. https://github.com/kubernetes-sigs/cli-utils/blob/master/pkg/object/validate.go#L124 |
Accurately speaking, kapply does not require this, since it sets the |
Thanks for clarifying. I don't know if having kapply do that really helps us test, but it might be trying to duplicate kpt and kubectl behavior. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
Short term fix is to disable implicit namespaces, since they don't work as-is: #482 Long term fix is unknown. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
Resources:
Output (from kpt using cli-utils master):
Problem:
The text was updated successfully, but these errors were encountered: