Go template with application set config make warn
i'm using application set config with go template like, thoses are working fine but two things not work (the feature enabled true for cluster)
and i have a warn message like
unknown field "metadata.$setElementOrder/finalizers"
i don't know what i'm doing wrong ?
the two configs file are
{
"source": {
"repoURL": "https://argoproj.github.io/argo-helm",
"targetRevision": "0.42.5",
"chart": "argo-workflows"
},
"project": "testing-apps",
"destination": {
"namespace": "argo-workflows"
},
"syncPolicy": {
"syncOptions": {
"CreateNamespace": true
}
},
"clusters": {
"in-cluster": {
"enabled": true,
"valuesRevision": "main"
}
}
}
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: discovery-all-clusters
namespace: kube-infra
spec:
goTemplate: true
generators:
# Create a matrix generator that will install all chart in all clusters
- matrix:
generators:
# Get all clusters
- clusters: {}
- git:
repoURL: [email protected]:xxx/continuous-delivery.git
#revision: main
revision: main
files:
# Find all .argocd.json in cc folder
- path: 'deployed-charts/**/.argocd.json'
values:
# Add enabled field if clusters.${name}.enabled = true
# name comes from the cluster generator
enabled: '{{ dig "clusters" .name "enabled" false . }}'
# selector:
# matchLabel:
# enabled: "true"
template:
metadata:
name: '{{ .name }}-{{ .path.basename }}'
spec:
ignoreDifferences: ## for vault
- group: admissionregistration.k8s.io
kind: MutatingWebhookConfiguration
jqPathExpressions:
- .webhooks[]?.clientConfig.caBundle
# project: '{{ .project }}'
project: raspberry-apps
sources:
# First source is for value files
# Default revision is HEAD but can be overriden with clusters.${name}.valuesRevision
- repoURL: [email protected]:xxxx/continuous-delivery.git
targetRevision: '{{ dig "clusters" .name "valuesRevision" "main" . }}'
ref: values
# Second source is for chart
# Default revision is .source.targetRevision but can be overriden with clusters.${name}.chartRevision
- repoURL: '{{ .source.repoURL }}'
targetRevision: '{{ dig "clusters" .name "chartRevision" .source.targetRevision . }}'
chart: '{{ default "" .source.chart }}'
path: '{{ default "" .source.path }}'
helm:
#releaseName: '{{ .path.basename }}'
valueFiles:
- $values/{{ .path.path }}/values.yaml
- $values/{{ .path.path }}/values.{{ .name }}.yaml
destination:
name: '{{ .name }}' ## from cluster generator
namespace: '{{ .destination.namespace }}' ## from file json
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace={{ dig "syncPolicy" "syncOptions" "CreateNamespace" "true" . }}
- ServerSideApply={{ dig "syncPolicy" "syncOptions" "ServerSideApply" "false" . }}
retry:
limit: 3 # number of failed sync attempt retries; unlimited number of attempts if less than 0
backoff:
duration: 15s # the amount to back off. Default unit is seconds, but could also be a duration (e.g. "2m", "1h")
factor: 2 # a factor to multiply the base duration after each failed retry
maxDuration: 20m
Checklist:
- [x] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- [x] I've included steps to reproduce the bug.
- [x] I've pasted the output of
argocd version.
Describe the bug
unknown field "metadata.$setElementOrder/finalizers"
To Reproduce
just add config
Expected behavior
not warning
Version
Image: quay.io/argoproj/argocd:v2.12.4
Logs
Paste any relevant application logs here.
Did you recently enable "server-side diff" for your Argo-CD instance? The error message probably comes from kubectl when validating the generated Application resources.
Is your ApplicationSet generating Applications that you previously created manually?
Do you mind sharing your Argo-CD configuration?
Where exactly do you see this warning?
i see this warning in application controller log. i don't remember if i have application deployed manually maybe. i can share my config, but value file is huge... do you think there is a problem in my template ?
Can you share the sources from git, please? If it's too big, maybe search for metadata, setElementOrder and finalizers and paste those parts.
i'm not sur what you want ?. i have provided the example above, what do you need ?
Sorry, I meant helm charts and values.yaml files.
i can provide in private if you want.
Feel free to send via CNCF Slack, I'm Andrii Korotkov (Verkada) there.
@didlawowo How did you resolve the issue?
i don't resolve it i have made many investigation the conclusion is, it's conflict between argo and kubernetes finalizer i have tried to make some conflict to exclude it but don't work
params:
resource.customizations.ignoreDifferences.argoproj.io_Application: |
jqPathExpressions:
- .metadata.finalizers[]? | select(. == "post-delete-finalizer.argocd.argoproj.io" or . == "post-delete-finalizer.argocd.argoproj.io/cleanup")
- if (.metadata.finalizers | length) == 0 then .metadata.finalizers else empty end
To I am facing the same warning. I have no further details yet. @didlawowo Do you have additional Information from your end. I see the issue being closed.
i'm sorry i have not resolve the problem.
We are also facing same issue. Warning itself is not explanatory to look to specific blog. We are using mono repo with more than 40+ applications, it is very hard to get into details what create the problem.
We are facing the same issue after adding a second finalizer to our applications next to "resources-finalizer.argocd.argoproj.io" on argo version: v3.1.0+03c4ad8