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: issue with variable brackets inside any string in extra_vars #868

Merged
merged 6 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- filetree_create export extra_vars with escaping any variable brackets
...
2 changes: 1 addition & 1 deletion roles/filetree_create/templates/current_job_templates.j2
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ controller_templates:
{% endif %}
{% if current_job_templates_asset_value.extra_vars and current_job_templates_asset_value.extra_vars | length > 3 %}
extra_vars:
{{ current_job_templates_asset_value.extra_vars | from_yaml | to_nice_yaml(indent=2) | indent(width=6, first=False) | replace("'{{", "!unsafe \'{{") }}
{{ current_job_templates_asset_value.extra_vars | from_yaml | to_nice_yaml(indent=2) | indent(width=6, first=False) | replace("{{", "{% raw %}{{{% endraw %}") | replace("}}", "{% raw %}}}{% endraw %}") }}
{%- endif %}
job_tags: "{{ current_job_templates_asset_value.job_tags }}"
force_handlers: {{ current_job_templates_asset_value.force_handlers | bool | lower }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ controller_workflows:
webhook_service: "{{ current_workflow_job_templates_asset_value.webhook_service }}"
{% if current_workflow_job_templates_asset_value.extra_vars and current_workflow_job_templates_asset_value.extra_vars | length > 3 %}
extra_vars:
{{ current_workflow_job_templates_asset_value.extra_vars | from_yaml | to_nice_yaml(indent=2) | indent(width=6, first=False) | replace("'{{", "!unsafe \'{{") }}
{{ current_workflow_job_templates_asset_value.extra_vars | from_yaml | to_nice_yaml(indent=2) | indent(width=6, first=False) | replace("{{", "{% raw %}{{{% endraw %}") | replace("}}", "{% raw %}}}{% endraw %}") }}
{%- endif %}
{% if query_labels | length > 0 %}
labels:
Expand Down
Loading