-
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
YAML anchors and aliases return error on List types #3614
Comments
Possibly related with #3500 |
This issue affects the TektonCD release.yaml. Any Kustomize version after
The full YAML is linked from upstream above. But the root cause seems to be this spec.versions that's part of many of Tekton's CRDs:
|
Confirmed this is because of the conversion to and from JSON. This should be fixed after #3271 is done. |
Anyone figured out workarounds? |
In case it's helpful to someone else, here's my (very limited) workaround: a generator plugin (wouldn't work as a transformer). Assuming Put this in #!/usr/bin/env bash
# Workaround for https://github.com/kubernetes-sigs/kustomize/issues/3614
if ! [ -x "$(command -v yq)" ]; then
echo "Error: please install yq."
exit 1
fi
shift # skip config file. exec plugins pass 'argsOneLiner'
SRC="$@"
# Invoke on specified source yml
yq r -X "$SRC"
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
generators:
- kust-3614-hack.yaml
apiVersion: some.org/v1
kind: ExplodeAnchors
metadata:
name: explode-anchors
argsOneLiner: problematic.yaml |
I'm consolidating all the issues related to YAML anchors on this one: #3675. Though they don't all fail with the same error message, they seem to all be related to the switch to kyaml. If you're encountering this issue and YAML anchor support is important to you, please chime in over there. /close |
@KnVerey: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Describe the bug
There appears to be a bug regarding how kyaml deals with yaml anchors and alises. This issue effects kustomize v3.9.2 - v4.0.1
Files that can reproduce the issue
kustomization.yaml
test.yaml
Expected output
Using kustomize v3.9.2, I can run the above code successfully via
kustomize build . --enable_kyaml=false
Actual output
Using kustomize v4.0.1:
Kustomize version
Platform
Linux
Additional context
It could be related to #3446 , but I don't understand how this is related to anchors and aliases.
The text was updated successfully, but these errors were encountered: