Open afreyermuth98 opened 1 month ago
Have you tried adding '.' before referring values? Like {{.chartName}}. And try to wrap in quotes as well.
Yes same issue :
error: error parsing application_sets/karpenter.yaml: error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{".chartName":interface {}(nil)}
You have {{ name }}
and `{{ cluster }}
but you have nothing defining it
- matrix:
generators:
# - clusters: {}
- list:
elements:
- appName: karpenter
chartName: karpenter
repoUrl: public.ecr.aws/karpenter
targetRevision: 0.37.0
namespace: karpenter
You've commented out clusters
therefore those two variables never get set
@christianh814 sorry it's just a typo, it's not commented on my current setup 😬
@afreyermuth98 Does this work?
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: test
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
# Generator for apps that should deploy to chosen cluster.
- matrix:
generators:
- clusters: {}
- list:
elements:
- appName: karpenter
chartName: karpenter
repoUrl: public.ecr.aws/karpenter
targetRevision: 0.37.0
namespace: karpenter
template:
metadata:
name: '{{ .name }}-{{ .appName }}'
annotations:
argocd.argoproj.io/manifest-generate-paths: '.;..'
spec:
project: test
source:
chart: '{{ .chartName }}'
repoURL: '{{ .repoUrl }}'
targetRevision: '{{ .targetRevision }}'
helm:
valueFiles:
- '../../values/{{ .name }}/{{ .appName }}/{{ .cluster }}/values.yaml'
destination:
name: '{{ .name }}'
namespace: '{{ .namespace }}'
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
retry:
limit: 2
Also {{ .cluster }}
is never defined (see documentation) so I took it out. I think you meant "name"
Yes it is thanks a lot ! It only needed the quotes I guess ?
Describe the bug
I'm trying to make a basic generator to deploy multiple apps with ArgoCD but I'm getting invalid map key on my values
To Reproduce
And when I'm applying this, I'm getting
error: error parsing application_sets/karpenter.yaml: error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{"chartName":interface {}(nil)}
Expected behavior The kubectl apply to pass
Screenshots
Version
Logs