Open hans-d opened 3 years ago
@hans-d did you ever figure out the appropriate syntax for this?
If anyone is still trying to figure this out, with a lot of guess/checking, looking through code and PRs, seems there is a way to do this now. Documentations for this seems to be missing.
In 2.5.x they added the ability to do "go template" syntax, so you can add
goTemplate: true
and access the slash labels and annotations like this
{{ index .metadata.labels "argocd.argoproj.io/secret-type" }}
edit: found the doc here: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/GoTemplate/#cluster-generators
see:
166
When using a cluster generator, I want to reference a label that contains a slash in the name, eg
argocd.argoproj.io/secret-type
, via{{ metadata.labels.argocd.argoproj.io/secret-type }}
Besides the fact it doesnt feel right to provide the key which contains dots without escaping, (eg
{{ metadata.label.[argocd.argoproj.io/secret-type] }}
like kustomize), it complains about the slash:It does get created initially, but fails to reconcile