Closed DanielYWoo closed 1 year ago
the curly brackets ({}
) are invalid yaml characters.
you should build your manifest and only then pass it to kubeconform for validation.
I fixed it by extra double quotes around the literals. I guess this is a very special case, for normal helm or kustomize YAML I can render them locally then let kubeconform deal with it. This code snippet is from an ArgoCD application set, I cannot find a way to render it locally without ArgoCD, so I have to pass it to kubeconform. ;-)
so in this case the solution is passing it as a string as you found out :)
Yes, I figured it out, but, is it possible to print a better error message by any chance?
sure! It's an open-source project, so you or someone from the community is more than welcome to contribute a PR
Hi @DanielYWoo , it looks like the error comes from the Go YAML parser Kubeconform uses https://github.com/kubernetes-sigs/yaml (the one Kubernetes uses too, I believe) which relies on https://github.com/go-yaml/yaml - which throws this error. A nicer error would be good, but it requires fixing a number of external dependencies which falls a bit outside of the time I can allocate to this project. Sorry :(
The error message can be better. e.g., for the YAML below
kubeconform tells me something is wrong, but ain't tell me what is wrong.