Skip to content

Use annotations with special characters #10277

Answered by crenshaw-dev
sambonbonne asked this question in Q&A
Discussion options

You must be logged in to vote

@sambonbonne the current templating logic is super simplistic:

https://github.com/argoproj/argo-cd/blob/master/applicationset/generators/cluster.go#L141-L143

I think you could simply use metadata.annoations.app.project.com/overlay. Under the hood, the template "key" is a simple string, so fasttemplate should interpret that whole string as one "thing" and replace it with the annotation value.

In 2.5, accessing parameters as go structures will be possible, so folks will end up using something like {{ index .metadata.annotations "app.project.com/overlay" }}. For fasttemplate (the default and, in <=2.4 the only, option), {{ metadata.annoations.app.project.com/overlay }} is the way to go.

I'd …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by sambonbonne
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants