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

Fix support for multiple --tla-code arguments #574

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

mihaitodor
Copy link
Contributor

While running the tk apply command with multiple --tla-code arguments, each containing a key='value' parameter, I noticed that the JSONNET code would not receive them correctly. More specifically, instead of being passed as named parameters, they are passed as positional parameters and since they're stored in a jsonnet.InjectedCode map, they end up being serialised in an arbitrary order which differs each time Tanka is run. I added a test in this PR which highlights this issue (you might need to run it multiple times to get a failure).

Note that this issue only surfaces when using multiple --tla-code args when calling tk apply.

I am rather new to this tool, so I'm not fully aware of all the ways in which people use the --tla-code argument. Please let me know if I missed any other edge cases.

@mihaitodor
Copy link
Contributor Author

@malcolmholmes I think this might interest you, since I noticed you got mentioned in #464, where this code was initially implemented.

Copy link
Member

@Duologic Duologic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Duologic Duologic merged commit caea9de into grafana:main Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants