From 6c22b08626b41a039e84287791bb2481c145914e Mon Sep 17 00:00:00 2001 From: pkomarov Date: Sun, 31 May 2026 10:26:00 +0300 Subject: [PATCH] add ignoreDifferences to schema Related change: https://gitlab.cee.redhat.com/rhos-gitops/examples/-/merge_requests/85 Jira: https://redhat.atlassian.net/browse/OSPRH-29702 --- charts/rhoso-apps/templates/_helpers.tpl | 13 +++++++++++++ charts/rhoso-apps/templates/application.yaml | 1 + charts/rhoso-apps/values.schema.json | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/charts/rhoso-apps/templates/_helpers.tpl b/charts/rhoso-apps/templates/_helpers.tpl index 6dd9b07..ea53df7 100644 --- a/charts/rhoso-apps/templates/_helpers.tpl +++ b/charts/rhoso-apps/templates/_helpers.tpl @@ -96,3 +96,16 @@ Pass dict with key "app" (per-application values map). {{- $f := default (list "resources-finalizer.argocd.argoproj.io/background") $app.finalizers }} {{- toYaml $f -}} {{- end }} + +{{/* +Optional spec.ignoreDifferences (Argo CD ignoreDifferences). +Pass dict with key "app" (per-application values map). Omitted if unset or empty. +*/}} +{{- define "rhoso-apps.ignoreDifferences" -}} +{{- $app := .app -}} +{{- $ignore := $app.ignoreDifferences | default list }} +{{- if not (empty $ignore) }} + ignoreDifferences: +{{ toYaml $ignore | indent 4 }} +{{- end }} +{{- end }} diff --git a/charts/rhoso-apps/templates/application.yaml b/charts/rhoso-apps/templates/application.yaml index 71ed96f..f6213c8 100644 --- a/charts/rhoso-apps/templates/application.yaml +++ b/charts/rhoso-apps/templates/application.yaml @@ -19,6 +19,7 @@ spec: {{ include "rhoso-apps.sourceKustomize" (dict "app" $app) }} destination: server: {{ include "rhoso-apps.destinationServer" $ }} +{{ include "rhoso-apps.ignoreDifferences" (dict "app" $app) }} {{ include "rhoso-apps.syncPolicySpec" (dict "app" $app) }} {{- end }} {{- end }} diff --git a/charts/rhoso-apps/values.schema.json b/charts/rhoso-apps/values.schema.json index ef154eb..02e0c71 100644 --- a/charts/rhoso-apps/values.schema.json +++ b/charts/rhoso-apps/values.schema.json @@ -111,6 +111,14 @@ "resources-finalizer.argocd.argoproj.io/foreground" ] } + }, + "ignoreDifferences": { + "type": "array", + "description": "Argo CD spec.ignoreDifferences to ignore fields during sync comparison.", + "items": { + "type": "object", + "additionalProperties": true + } } } }