-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Describe the bug
Hi Argo Helm team,
This is a follow-up to issue #2528, but with a more specific diagnosis and a potential improvement.
Problem
Currently, setting artifactRepository.azure.blobNameFormat
to include workflow or pod template variables does not work unless the user escapes each template placeholder manually, like so:
artifactRepository:
azure:
blobNameFormat: '{{"{{"}}workflow.creationTimestamp.Y{{"}}"}}/{{"{{"}}workflow.creationTimestamp.m{{"}}"}}/...'
This is because the Helm chart templates the entire azure block with:
azure: {{- tpl (toYaml .) $ | nindent 8 }}
As a result, any {{ }}
inside values like blobNameFormat are rendered by Helm instead of being passed through to the workflow controller for evaluation at runtime.
Why This Works for S3
By contrast, the s3 block is not fully templated, and individual fields like keyFormat are quoted instead:
keyFormat: {{ .Values.artifactRepository.s3.keyFormat | quote }}
This allows setting a value like:
artifactRepository:
s3:
keyFormat: "{{workflow.creationTimestamp.Y}}/{{workflow.namespace}}/..."
...without needing to escape any template expressions.
Proposed Fix
To bring consistency and ease of use, I suggest aligning the handling of the azure block with the s3 block:
Instead of templating the whole azure block with tpl, template only individual fields (e.g., use {{ tpl .Values.artifactRepository.s3.accountKeySecret.key . }}
)
Alternatively, document clearly that users need to escape templates within blobNameFormat for Azure, though this is less user-friendly
Would be happy to submit a PR if a direction is agreed upon.
Thanks for your great work!
Related helm chart
argo-workflows
Helm chart version
current main
(but the issue is present since 0.26.6, see the referenced issue)