Unable to render parameters in slack message template in sensor #3669
Unanswered
SrilakshmiDoma14
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently adding a Sensor that sends messages to Slack. I would like to dynamically adjust the content of the message using parameters. However, I haven't been successful in getting them to render properly.
For example, I want the message to look like:
test-app deployed successfully in defaultBut instead, I get:
*{{ app.name }}* deployed successfully in {{ app.namespace }}!!Here's my Sensor configuration:
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: argo-slack-sensor
namespace: operations
spec:
eventBusName: argo-kafka-bus
dependencies:
- name: deployment-sensor
eventSourceName: deployment-watcher
eventName:k8s-events
filters:
data:
- path: body.kind
type: string
value:
- Deployment
triggers:
- template:
name: slack-notification
slack:
slackToken:
name: slack-token
key: token
channel: "#debug"
retry:
retries: 1
intervalSeconds: 5
message: |
{{ app.name }} deployed successfully in {{ app.namespace }}!!
parameters:
- src:
dependencyName: argo-deployment-sensor
dataKey: body.metadata.name
dest: app.name
- template:
name: debug-payload
log:
intervalSeconds: 0
format: |
Full Event: {{ .Input | toJson }}
Event Type: {{ .Input.body.type }}
App: {{ app.name }}
Namespace: {{ app.namespace }}
parameters:
- src:
dependencyName: argo-deployment-sensor
dataKey: body.metadata.name
dest: app.name
- src:
dependencyName: argo-deployment-sensor
dataKey: body.metadata.namespace
dest: app.namespace
The parameters are rendering right in debug payload but not in slack message.
Is there something wrong with my configuration or how I'm using the parameters in the Slack message?
Any help is appreciated — thanks!
Beta Was this translation helpful? Give feedback.
All reactions