diff --git a/argocd/templates/apps.yaml b/argocd/templates/apps.yaml index a71ee05..1c595c7 100644 --- a/argocd/templates/apps.yaml +++ b/argocd/templates/apps.yaml @@ -24,6 +24,14 @@ spec: destination: server: https://kubernetes.default.svc namespace: {{ $ns }} + {{- /* Champs à exclure du diff (ex: /spec/volumeName d'un PVC rebindé à la + main après le drill coupure de courant — immuable côté API). À coupler + avec la syncOption RespectIgnoreDifferences=true pour que l'apply + réinjecte la valeur live au lieu de tenter de la vider. */}} + {{- with $app_attr.ignoreDifferences }} + ignoreDifferences: + {{- toYaml . | nindent 4 }} + {{- end }} syncPolicy: {{- if $app_attr.syncPolicy }} {{- toYaml $app_attr.syncPolicy | nindent 4 }} @@ -34,6 +42,9 @@ spec: {{- end }} syncOptions: - CreateNamespace=true + {{- range $app_attr.syncOptions }} + - {{ . }} + {{- end }} {{- /* Non-prod environments (ADR-0002 elision rule): one extra Application per env under `.envs`. Each renders the SAME repo + chart, overlaid with diff --git a/argocd/values.yaml b/argocd/values.yaml index 60fab3c..bbdc5d5 100644 --- a/argocd/values.yaml +++ b/argocd/values.yaml @@ -4,6 +4,15 @@ gitea_applications: url-shortener: annotations: {} + # Le PVC live a un spec.volumeName épinglé (rebind du volume Longhorn) que + # le chart ne déclare pas : sans ceci, chaque sync tente de le vider et + # l'API le refuse (spec immuable) → SyncError permanent. + ignoreDifferences: + - kind: PersistentVolumeClaim + jsonPointers: + - /spec/volumeName + syncOptions: + - RespectIgnoreDifferences=true tools: annotations: {} syncPolicy: