You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Secrets defined in argocd-notifications-secret are not accessible via {{ secrets.xx }} in notifications template. A feature to replace secrets inside a template was implemented here.
Given this template configuration inside argocd-notifications-cm configmap:
Failed to notify recipient {gh-poc } defined in resource argocd/REDACTED:
request to {{ \"event_type\": \"poc\" }\n POST https://api.github.com/repos/REDACTED/REDACTED/dispatches gh-poc}
has failed with error code 401
: {\"message\":\"Bad credentials\",\"documentation_url\":\"https://docs.github.com/rest\"} using the configuration in
namespace argocd" resource=argocd/REDACTED
If secret value is hardcoded in configmap's template, webhook request obviously passes:
The only differences that I can see between docs and this example:
example in this issue uses data in Kubernetes Secret, while docs uses stringData. IMHO both data and stringData should work equally here.
docs use secret inside a template, while example in this issue uses secret inside service.webhook configuration. IMHO both should be supported
To Reproduce
Apply example from above verbatim, into argocd v2.10.4
Expected behavior
Expect secret value defined in service.webhook to be propagated and properly replaced. Since token .secrets.ghPocToken is not replaced at all - I would expect either an empty string "" or an error being logged/thrown if value is not found - I hypothesize the placeholder is not replaced inside the template.
Screenshots
Version
v2.10.4
Logs
Paste any relevant application logs here.
The text was updated successfully, but these errors were encountered:
ivanivicrho
changed the title
Secrets within notification templates are not replaced
Secrets within notification's service.webhook are not replaced
Mar 26, 2024
ivanivicrho
changed the title
Secrets within notification's service.webhook are not replaced
Secrets within notifications-controller service.webhook are not replaced
Mar 26, 2024
Leaving the comment here, as different ways the separate part of argocd NS system (notifications-engine, and templating) are configured to fetch secrets causes quite a bit of friction.
In templates, it is:
{{ .secrets.SOME_VALUE }}
In services, it is:
$SOME_VALUE
Hopefully this comment will help someone else who is stuck on a similar issue.
Checklist:
argocd version
.Describe the bug
ArgoCD and Notification Controller
v2.10.4
Secrets defined in
argocd-notifications-secret
are not accessible via{{ secrets.xx }}
in notifications template. A feature to replace secrets inside a template was implemented here.Given this template configuration inside
argocd-notifications-cm
configmap:and a
argocd-notifications-secret
secret:This results in:
If secret value is hardcoded in configmap's template, webhook request obviously passes:
The only differences that I can see between docs and this example:
data
in Kubernetes Secret, while docs usesstringData
. IMHO bothdata
andstringData
should work equally here.service.webhook
configuration. IMHO both should be supportedTo Reproduce
Apply example from above verbatim, into argocd v2.10.4
Expected behavior
Expect secret value defined in
service.webhook
to be propagated and properly replaced. Since token.secrets.ghPocToken
is not replaced at all - I would expect either an empty string "" or an error being logged/thrown if value is not found - I hypothesize the placeholder is not replaced inside the template.Screenshots
Version
v2.10.4
Logs
The text was updated successfully, but these errors were encountered: