Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

is there a way to add the cluster name as context for slack notication? #67

Closed
renperez opened this issue Apr 1, 2020 · 6 comments
Closed
Labels
question Further information is requested

Comments

@renperez
Copy link

renperez commented Apr 1, 2020

I want to add the cluster name on my slack notification. is there a way to add that? I was able to add the context for argocd url but was wondering if i can add the cluster name as well, since we are using argo for multiple cluster.

@alexmt
Copy link
Collaborator

alexmt commented Apr 1, 2020

Hello @renperez ,

Yes, context might contain any key, not just argocdUrl.

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
data:
  config.yaml: |
    context:
      argocdUrl: <argocd-url>
      clusterName: <clusterName>

The value might be used as {{.context.clusterName}}

@alexmt alexmt added the question Further information is requested label Apr 1, 2020
@renperez
Copy link
Author

renperez commented Apr 1, 2020

thanks @alexmt. I tried adding it with this value {{.context.clusterName}} and the slack notification stopped working. is this the correct value?

@alexmt
Copy link
Collaborator

alexmt commented Apr 1, 2020

The {{.context.clusterName}} was added to the template, right? Can you please share the template?

Also feel free to join our slack: https://argoproj.github.io/community/join-slack . It will be easier to troubleshoot

@keanlee
Copy link

keanlee commented Apr 20, 2020

ClusterName: . seem the {{.context.clusterName}} is not work?

@keanlee
Copy link

keanlee commented Apr 20, 2020

ClusterName: . seem the {{.context.clusterName}} is not work?

#67 (comment)

@alexmt
Copy link
Collaborator

alexmt commented May 8, 2020

Hello @keanlee, @renperez ,

I've implemented a CLI commands that helps troubleshooting configuration issues.

The CLI is not released yet but available in argoprojlabs/argocd-notifications:latest image . You might use it as follows:

  • save argocd-notification-cm into local file.

  • use template notify command to generate notification in debug mode

docker run --rm -it  -w /src -v $(pwd):/src  argoprojlabs/argocd-notifications:latest \
  /app/argocd-notifications tools template notify app-sync-succeeded foobar.yaml --config-map config-map.yaml --secret :empty

Give it a try please.

@alexmt alexmt closed this as completed Feb 3, 2021
@argoproj-labs argoproj-labs locked and limited conversation to collaborators Feb 3, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants