notification controller does not strip new line and the end of URL
gecube opened this issue · 0 comments
gecube commented
Hi!
- get the URL from Slack
https://hooks.slack.com/services/*****/*****/*****
- convert it to base64:
echo https://hooks.slack.com/services/*****/*****/***** | base64
aHR0c***********************************wCg==
- put it into secret.
- get the error in notification controller:
{"level":"error","ts":"2024-03-09T14:07:40.439Z","logger":"event-server","msg":"failed to dispatch notification","eventInvolvedObject":{"kind":"Kustomization","namespace":"flux-system","name":"databases","uid":"2023d4c3-d3f8-4f6f-8438-a090f8138cae","apiVersion":"kustomize.toolkit.fluxcd.io/v1","resourceVersion":"101895664"},"Alert":{"name":"slack-p1","namespace":"flux-system"},"error":"failed to initialize notifier for provider 'slack-p1': failed to initialize notifier: invalid Slack hook URL https://hooks.slack.com/services/*****/*****/*****\n: 'parse \"https://hooks.slack.com/services/*****/*****/*****\\n\": net/url: invalid control character in URL'"}
Expected behaviour:
if the URL with the trailing \n
- then just strip it.