Description
This is a Bug Report
Problem:
Commit b9da040 / PR #30348. That PR documented a bug in Kustomize as though it were a feature, and unfortunately nobody from the Kustomize team saw the PR.
The behaviour in question is considered very problematic and clearly undesirable, as it violates two Kustomize's core principles/guarantees: being a template-free solution and having no build-time side-effects. In fact, in Kustomize's own docs, this behaviour is explicitly documented as something Kustomize will never support: Eschewed Features list.
Both Kustomize maintainers agree on this point, and we were also able to confirm with the person who originally copied the offending code from kubectl that this behaviour came along with that code entirely by accident.
Proposed Solution:
- Revert the PR, with or without a warning about relying on the behaviour (I originally proposed a straight revert, and added the warning at the request of the docs team. I am happy either way, as long as we get this problematic recommendation down ASAP): Revert documentation of Kustomize bug as a feature #35522
- A warning is already being emitted when the behaviour occurs in the latest version of Kustomize: Emit a warning when env loading bug is being relied on kubernetes-sigs/kustomize#4730.
Page to Update:
https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/