Skip to content

Conversation

@cktpw
Copy link

@cktpw cktpw commented Nov 3, 2025

Checklist:

  • I have bumped the chart version according to versioning
  • I have updated the documentation according to documentation
  • I have updated the chart changelog with all the changes that come with this pull request according to changelog.
  • Any new values are backwards compatible and/or have sensible default.
  • I have signed off all my commits as required by DCO.
  • I have created a separate pull request for each chart according to pull requests
  • My build is green (troubleshooting builds).

{{- tpl (toYaml .) $ | nindent 2 }}
{{- else }}
{{- toYaml . | nindent 2 }}
{{- end }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any problem if we just support tpl ? As you can see there is no format parameters in all of argo-helm, though we have some logics to support tpl.

{{- with .Values.notifications.notifiers }}
  {{- tpl (toYaml .) $ | nindent 2 }}
{{- end }}

Copy link
Author

@cktpw cktpw Nov 4, 2025

Choose a reason for hiding this comment

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

Both Argo notifications and Helm use {{ and }} for interpolation. So if someone wants to use {{.rollout.metadata.namespace}} with tpl they'll have to escape the {{ and }} with like this: {{"{{"}}.rollout.metadata.namespace{{"}}"}}.

Using tpl alone would throw errors if someone just do {{.rollout.metadata.namespace}} because that doesn't exist in Helm's context.

The reason I had to do this is because rollouts doesn't support the context.rolloutsUrl like ArgoCD does with context.argocdUrl and I need to provide different Rollout's root URL per Rollout's deployment.

Here's how I did it with the enhancement above. With this method, I can provide a different value for notifications.rolloutsUrl for each deployment of Rollouts.

  notifications:
    secret:
      create: false

    rolloutsUrl: https://rollouts.staging.example.com

    notifiers:
      service.slack: |
        token: $slack-token

    triggers:
      trigger.on-rollout-updated: |
        - send: [rollout-updated]

    templates:
      format: template
      template.rollout-updated: |
        slack:
          attachments: |
            [{
              "title": "Rollout for {{"{{"}}.rollout.metadata.name{{"}}"}} in progress",
              "title_link": "{{.Values.notifications.rolloutsUrl}}/rollouts/rollout/{{"{{"}}.rollout.metadata.namespace{{"}}"}}/{{"{{"}}.rollout.metadata.name{{"}}"}}",
              "color": "#ffe000",
              "fields": [],
              "mrkdwn_in": ["fields"]
            }]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants