Skip to content
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

jsonnet std.parseYaml wraps result in an array when string values contain --- #17676

Open
3 tasks done
SamuraiPrinciple opened this issue Mar 31, 2024 · 1 comment
Open
3 tasks done
Labels
bug Something isn't working

Comments

@SamuraiPrinciple
Copy link

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

When using Jsonnet to generate manifests, std.parseYaml function returns incorrect result when string values contain ---

I've also filed an issue here:

google/jsonnet#1147

Jsonnet go implementation (https://github.com/google/go-jsonnet) seems unaffected when I tested it locally (which is strange, because I believe that's the version argocd is using).

To Reproduce

Create an app with test.jsonnet file with the following content:

{
  apiVersion: 'v1',
  kind: 'ConfigMap',
  metadata: { name: 'repro' },
  data: {
    'key': std.parseYaml('a: bad---'),
  },
}

Expected behavior

the key value should be {"a": "bad---"} and not [{"a": "bad---"}]

Screenshots

Screenshot 2024-03-31 at 15 43 54

Version

argocd: v2.10.5+335875d
  BuildDate: 2024-03-28T15:02:45Z
  GitCommit: 335875d13e018bed6e03873f4742582582964745
  GitTreeState: clean
  GoVersion: go1.21.3
  Compiler: gc
  Platform: linux/amd64
FATA[0000] Argo CD server address unspecified           

Logs

Not relevant

@SamuraiPrinciple SamuraiPrinciple added the bug Something isn't working label Mar 31, 2024
@SamuraiPrinciple
Copy link
Author

SamuraiPrinciple commented Apr 1, 2024

Apologies, after receiving some feedback on issue google/jsonnet#1147 I've realised that I've got it wrong way around - it's the go-jsonnet version that affected (which explains why argocd is affected too). Also, opened the issue in relevant project now - google/go-jsonnet#749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant