-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Regression with yaml anchors in Kustomize v5 #5061
Comments
we are running into this issue too
|
It might be that this is coming from upstream in kubernetes-sigs/yaml: kubernetes-sigs/yaml#46 |
no that bug is years old. this is a recent regression in kustomize 5 |
@jskrzypek is correct--this is a bug from upstream kubernetes-sigs/yaml. Kustomize 5.0 switched to using A different yaml library we use handles anchors correctly in strict mode, but we will disrupt some users if we switch to it, because unlike sig-yaml, it enforces case-sensitive field names. For example, the In the long run, kubernetes-sigs/yaml#72 might provide a solution. That will eventually be a go-yaml.v3 fork that is more backwards compatible with yaml.v2, which probably means supporting case-insensitive keys. But nobody has had time to push that forward lately. We may need to revert the change to strict decoding, re-introducing the other bug, if we can't come up with a better solution. /triage accepted |
What happened?
I was using yaml anchors successfully in kustomize v4 inside of a replacements transformer. The replacements transformer appeared to have received some fixes in kustomize v5, so I upgraded. When I did, some code that had been working in v4 stopped working, and I started getting errors complaining about having multiple keys in an mapping that has an anchor.
With v5 it produces this error
What did you expect to happen?
I expected kustomize to continue correctly handling yaml anchors in v5 as it did in v4. In v4 the same repo produces this valid & correct output:
How can we reproduce it (as minimally and precisely as possible)?
I created a minimal repoduction repo: https://github.com/jskrzypek/kustomizev5-yaml-anchor-bug
Expected output
Actual output
Kustomize version
v5.0.0
Operating system
MacOS
The text was updated successfully, but these errors were encountered: