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: make export --format respect "/" in template actions #572

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

dewe
Copy link
Contributor

@dewe dewe commented Jun 14, 2021

During tk export path separators are temporarily replaced with BEL char in order to protect paths from being mixed with template output. But when there is a slash in a template action (e.g. {{index .metadata.labels "app.kubernetes.io/name"}}, that slash also got replaced, and the template did not work as expected.

This fix ensures that the BEL replacement only occurs within the text portions of the template, and the action blocks are being preserved.

Fixes #568

@dewe dewe force-pushed the fix_export_format_path_replace branch from 2995ed5 to a748657 Compare June 14, 2021 06:40
During tk export path separators are temporarily replaced with BEL in
order to protect paths from being mixed with template output. But when
there is a slash in a template action (e.g. {{index .metadata.labels
"app.kubernetes.io/name"}}, that slash also got replaced, and the
template did not work as expected.

This fix ensures that the BEL replacement only occurs within the text
portions of the template, and the action blocks are being preserved.

Fixes grafana#568
@dewe dewe force-pushed the fix_export_format_path_replace branch from a748657 to 55e9359 Compare June 14, 2021 10:54
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.

Looks good from my point of view.

@Duologic Duologic merged commit 72d5517 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.

Unexpected filename when using export with kubernetes recommended labels
2 participants