From 8c13fea89577202aa8659256f6ee270c6f4b6b59 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Mon, 27 Jul 2026 12:17:51 +0200 Subject: [PATCH] Add custom ArgoCD Yaml support Tested manually with https://www.github.com/validatedpatterns/patterns-operator/pull/779 by passing the following to values-global.yaml: main: gitops: customArgoYaml: | controller: resources: limits: cpu: "4" memory: "17Gi" Correctly obtained the ArgoCD instance with: oc get -n vp-gitops argocd vp-gitops -o jsonpath='{.spec.controller.resources.limits}' | jq . { "cpu": "4", "memory": "17Gi" } --- templates/pattern-operator-configmap.yaml | 4 ++++ tests/pattern_operator_configmap_test.yaml | 19 +++++++++++++++++++ values.yaml | 4 ++++ 3 files changed, 27 insertions(+) diff --git a/templates/pattern-operator-configmap.yaml b/templates/pattern-operator-configmap.yaml index 149b6fc..7147009 100644 --- a/templates/pattern-operator-configmap.yaml +++ b/templates/pattern-operator-configmap.yaml @@ -17,6 +17,10 @@ data: gitops.argoRBAC: | {{ .Values.main.gitops.argoRBAC | indent 4 }} {{- end }} + {{- if .Values.main.gitops.customArgoYaml }} + gitops.customArgoYaml: | +{{ .Values.main.gitops.customArgoYaml | indent 4 }} + {{- end }} # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan diff --git a/tests/pattern_operator_configmap_test.yaml b/tests/pattern_operator_configmap_test.yaml index 05c27a0..47a581f 100644 --- a/tests/pattern_operator_configmap_test.yaml +++ b/tests/pattern_operator_configmap_test.yaml @@ -83,6 +83,25 @@ tests: - exists: path: data["gitops.argoRBAC"] + - it: Should not include gitops.customArgoYaml by default + asserts: + - notExists: + path: data["gitops.customArgoYaml"] + + - it: Should set gitops.customArgoYaml + set: + main: + gitops: + customArgoYaml: | + controller: + resources: + limits: + cpu: "4" + memory: "16Gi" + asserts: + - exists: + path: data["gitops.customArgoYaml"] + - it: Should set gitea parameters set: main: diff --git a/values.yaml b/values.yaml index 1365be8..6db495f 100644 --- a/values.yaml +++ b/values.yaml @@ -30,6 +30,10 @@ main: # -- Full ArgoCD RBAC spec as a YAML string. When set, it completely # overrides the default RBAC policy and additionalArgoAdmins is ignored. argoRBAC: "" + # -- Arbitrary ArgoCD .spec YAML to deep-merge into the operator-built + # ArgoCD CR. Allows customizing any part of the ArgoCD spec without + # requiring individual config keys. + customArgoYaml: "" # -- Settings related to the in-cluster gitea installation gitea: