From 9291a5bafdc6855fc5bf3ad0305efdce170a5eb9 Mon Sep 17 00:00:00 2001 From: Chris Butler Date: Tue, 3 Nov 2026 01:39:16 +0000 Subject: [PATCH 1/6] fix(configmap): render gitops.applicationHealthCheckEnabled and customHealthChecks The patterns-operator supports these keys on the patterns-operator-config ConfigMap but the chart never rendered them, so app-of-apps sync-wave gating was silently inert on every install through this chart (the operator defaults the health check to off, and ArgoCD 1.8 dropped the Application health check). Render each key when it is set, using the same idiom as the existing additionalArgoAdmins/argoRBAC/customArgoYaml blocks. Empty-string defaults preserve current behaviour. applicationHealthCheckEnabled is quoted because the operator compares strings.EqualFold(v, "true") against ConfigMap string data. Fixes #52 --- Chart.yaml | 2 +- README.md | 2 ++ templates/pattern-operator-configmap.yaml | 7 +++++ tests/pattern_operator_configmap_test.yaml | 35 ++++++++++++++++++++++ values.yaml | 10 +++++++ 5 files changed, 55 insertions(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index 33380a0..8585ae1 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -3,7 +3,7 @@ description: A Helm chart to build and deploy a Cloud Pattern via the patterns o keywords: - pattern name: pattern-install -version: 0.0.18 +version: 0.0.19 home: https://github.com/validatedpatterns/pattern-install-chart maintainers: - name: Validated Patterns Team diff --git a/README.md b/README.md index 1e10e1a..a7a8f5e 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,11 @@ This chart is used by the Validated Patterns installation script that can be fou | main.gitea.helmRepoUrl | string | `"https://charts.validatedpatterns.io/"` | Helm Repository URL for the gitea chart | | main.gitops | object | depends on the individual settings | Settings related to the gitops operator | | main.gitops.additionalArgoAdmins | string | `""` | Comma-separated list of additional ArgoCD admin groups. Only used when argoRBAC is not set. | +| main.gitops.applicationHealthCheckEnabled | string | `""` | Set to "true" to have the patterns operator restore the ArgoCD Application resource health check (dropped in ArgoCD 1.8). Required for app-of-apps sync-wave ordering: without it the root Application treats child Applications as healthy and applies all waves at once. The operator defaults this to false, so it must be set explicitly. | | main.gitops.argoRBAC | string | `""` | Full ArgoCD RBAC spec as a YAML string. When set, it completely overrides the default RBAC policy and additionalArgoAdmins is ignored. | | main.gitops.channel | string | `"gitops-1.21"` | Default channel to install the gitops operator from | | main.gitops.customArgoYaml | string | `""` | 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. | +| main.gitops.customHealthChecks | string | `""` | Additional resource health checks for the ArgoCD CR, as a YAML list string. Appended to the operator's built-in checks (PVC, Subscription, and Application when applicationHealthCheckEnabled is true). | | main.gitops.operatorSource | string | `"redhat-operators"` | Source to be used to install the gitops operator from | | main.multiSourceConfig.clusterGroupChartVersion | string | `nil` | The clustergroup chart version to be used when deploying a pattern (defaults to 0.8.*) | | main.multiSourceConfig.enabled | bool | `false` | Enables a multisource configuration for the clustergroup chart | diff --git a/templates/pattern-operator-configmap.yaml b/templates/pattern-operator-configmap.yaml index 7147009..747d9c7 100644 --- a/templates/pattern-operator-configmap.yaml +++ b/templates/pattern-operator-configmap.yaml @@ -21,6 +21,13 @@ data: gitops.customArgoYaml: | {{ .Values.main.gitops.customArgoYaml | indent 4 }} {{- end }} + {{- if .Values.main.gitops.applicationHealthCheckEnabled }} + gitops.applicationHealthCheckEnabled: {{ .Values.main.gitops.applicationHealthCheckEnabled | quote }} + {{- end }} + {{- if .Values.main.gitops.customHealthChecks }} + gitops.customHealthChecks: | +{{ .Values.main.gitops.customHealthChecks | 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 47a581f..71e52c2 100644 --- a/tests/pattern_operator_configmap_test.yaml +++ b/tests/pattern_operator_configmap_test.yaml @@ -102,6 +102,41 @@ tests: - exists: path: data["gitops.customArgoYaml"] + - it: Should not include gitops.applicationHealthCheckEnabled by default + asserts: + - notExists: + path: data["gitops.applicationHealthCheckEnabled"] + + - it: Should set gitops.applicationHealthCheckEnabled as a string + set: + main: + gitops: + applicationHealthCheckEnabled: "true" + asserts: + - equal: + path: data["gitops.applicationHealthCheckEnabled"] + value: "true" + + - it: Should not include gitops.customHealthChecks by default + asserts: + - notExists: + path: data["gitops.customHealthChecks"] + + - it: Should set gitops.customHealthChecks + set: + main: + gitops: + customHealthChecks: | + - group: example.com + kind: MyKind + check: | + hs = {} + hs.status = "Healthy" + return hs + asserts: + - exists: + path: data["gitops.customHealthChecks"] + - it: Should set gitea parameters set: main: diff --git a/values.yaml b/values.yaml index 6db495f..3408806 100644 --- a/values.yaml +++ b/values.yaml @@ -34,6 +34,16 @@ main: # ArgoCD CR. Allows customizing any part of the ArgoCD spec without # requiring individual config keys. customArgoYaml: "" + # -- Set to "true" to have the patterns operator restore the ArgoCD + # Application resource health check (dropped in ArgoCD 1.8). Required for + # app-of-apps sync-wave ordering: without it the root Application treats + # child Applications as healthy and applies all waves at once. The operator + # defaults this to false, so it must be set explicitly. + applicationHealthCheckEnabled: "" + # -- Additional resource health checks for the ArgoCD CR, as a YAML list + # string. Appended to the operator's built-in checks (PVC, Subscription, + # and Application when applicationHealthCheckEnabled is true). + customHealthChecks: "" # -- Settings related to the in-cluster gitea installation gitea: From acb0e6464648cc0974ec54cbc48a46e138f33be9 Mon Sep 17 00:00:00 2001 From: Chris Butler Date: Tue, 3 Nov 2026 01:39:56 +0000 Subject: [PATCH 2/6] fix(configmap): render gitops.sourceNamespace, installApprovalPlan and csv These operator-consumed keys were listed as comments in the template but never rendered, so they could only be set by writing the ConfigMap out of band. Render each when set, empty-string defaults preserving current behaviour. --- README.md | 3 ++ templates/pattern-operator-configmap.yaml | 11 +++++- tests/pattern_operator_configmap_test.yaml | 45 ++++++++++++++++++++++ values.yaml | 9 +++++ 4 files changed, 66 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7a8f5e..9d45868 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,10 @@ This chart is used by the Validated Patterns installation script that can be fou | main.gitops.channel | string | `"gitops-1.21"` | Default channel to install the gitops operator from | | main.gitops.customArgoYaml | string | `""` | 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. | | main.gitops.customHealthChecks | string | `""` | Additional resource health checks for the ArgoCD CR, as a YAML list string. Appended to the operator's built-in checks (PVC, Subscription, and Application when applicationHealthCheckEnabled is true). | +| main.gitops.csv | string | `""` | Starting CSV for the gitops operator install. Defaults to the operator's own default. | +| main.gitops.installApprovalPlan | string | `""` | Install plan approval mode for the gitops operator subscription (Automatic or Manual). Defaults to the operator's own default. | | main.gitops.operatorSource | string | `"redhat-operators"` | Source to be used to install the gitops operator from | +| main.gitops.sourceNamespace | string | `""` | Namespace of the catalog source the gitops operator is installed from. Defaults to the operator's own default (openshift-marketplace). | | main.multiSourceConfig.clusterGroupChartVersion | string | `nil` | The clustergroup chart version to be used when deploying a pattern (defaults to 0.8.*) | | main.multiSourceConfig.enabled | bool | `false` | Enables a multisource configuration for the clustergroup chart | | main.multiSourceConfig.helmRepoUrl | string | `nil` | The URL of the VP helm charts repository (defaults to https://charts.validatedpatterns.io) | diff --git a/templates/pattern-operator-configmap.yaml b/templates/pattern-operator-configmap.yaml index 747d9c7..2358b9e 100644 --- a/templates/pattern-operator-configmap.yaml +++ b/templates/pattern-operator-configmap.yaml @@ -28,8 +28,15 @@ data: gitops.customHealthChecks: | {{ .Values.main.gitops.customHealthChecks | indent 4 }} {{- end }} + {{- if .Values.main.gitops.sourceNamespace }} + gitops.sourceNamespace: {{ .Values.main.gitops.sourceNamespace }} + {{- end }} + {{- if .Values.main.gitops.installApprovalPlan }} + gitops.installApprovalPlan: {{ .Values.main.gitops.installApprovalPlan }} + {{- end }} + {{- if .Values.main.gitops.csv }} + gitops.csv: {{ .Values.main.gitops.csv }} + {{- end }} - # gitops.sourceNamespace: GitOpsDefaultCatalogSourceNamespace - # gitops.installApprovalPlan: GitOpsDefaultApprovalPlan # gitops.ManualSync: GitOpsDefaultManualSync # gitops.name: GitOpsDefaultPackageName diff --git a/tests/pattern_operator_configmap_test.yaml b/tests/pattern_operator_configmap_test.yaml index 71e52c2..de92b62 100644 --- a/tests/pattern_operator_configmap_test.yaml +++ b/tests/pattern_operator_configmap_test.yaml @@ -137,6 +137,51 @@ tests: - exists: path: data["gitops.customHealthChecks"] + - it: Should not include gitops.sourceNamespace by default + asserts: + - notExists: + path: data["gitops.sourceNamespace"] + + - it: Should set gitops.sourceNamespace + set: + main: + gitops: + sourceNamespace: openshift-marketplace + asserts: + - equal: + path: data["gitops.sourceNamespace"] + value: openshift-marketplace + + - it: Should not include gitops.installApprovalPlan by default + asserts: + - notExists: + path: data["gitops.installApprovalPlan"] + + - it: Should set gitops.installApprovalPlan + set: + main: + gitops: + installApprovalPlan: Manual + asserts: + - equal: + path: data["gitops.installApprovalPlan"] + value: Manual + + - it: Should not include gitops.csv by default + asserts: + - notExists: + path: data["gitops.csv"] + + - it: Should set gitops.csv + set: + main: + gitops: + csv: openshift-gitops-operator.v1.22.0 + asserts: + - equal: + path: data["gitops.csv"] + value: openshift-gitops-operator.v1.22.0 + - it: Should set gitea parameters set: main: diff --git a/values.yaml b/values.yaml index 3408806..ca4a44a 100644 --- a/values.yaml +++ b/values.yaml @@ -44,6 +44,15 @@ main: # string. Appended to the operator's built-in checks (PVC, Subscription, # and Application when applicationHealthCheckEnabled is true). customHealthChecks: "" + # -- Namespace of the catalog source the gitops operator is installed + # from. Defaults to the operator's own default (openshift-marketplace). + sourceNamespace: "" + # -- Install plan approval mode for the gitops operator subscription + # (Automatic or Manual). Defaults to the operator's own default. + installApprovalPlan: "" + # -- Starting CSV for the gitops operator install. Defaults to the + # operator's own default. + csv: "" # -- Settings related to the in-cluster gitea installation gitea: From 7e4c6ce9d8b082c5830e38f83993348b46efc508 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Tue, 10 Nov 2026 09:23:44 +0100 Subject: [PATCH 3/6] Address P1 issues from review --- templates/pattern-operator-configmap.yaml | 9 ++-- tests/pattern_operator_configmap_test.yaml | 48 ++++++++++++++++++++-- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/templates/pattern-operator-configmap.yaml b/templates/pattern-operator-configmap.yaml index 2358b9e..0dc97d2 100644 --- a/templates/pattern-operator-configmap.yaml +++ b/templates/pattern-operator-configmap.yaml @@ -25,17 +25,18 @@ data: gitops.applicationHealthCheckEnabled: {{ .Values.main.gitops.applicationHealthCheckEnabled | quote }} {{- end }} {{- if .Values.main.gitops.customHealthChecks }} + {{- $v := .Values.main.gitops.customHealthChecks }} gitops.customHealthChecks: | -{{ .Values.main.gitops.customHealthChecks | indent 4 }} +{{ if kindIs "string" $v }}{{ $v | indent 4 }}{{ else }}{{ toYaml $v | indent 4 }}{{ end }} {{- end }} {{- if .Values.main.gitops.sourceNamespace }} - gitops.sourceNamespace: {{ .Values.main.gitops.sourceNamespace }} + gitops.sourceNamespace: {{ .Values.main.gitops.sourceNamespace | quote }} {{- end }} {{- if .Values.main.gitops.installApprovalPlan }} - gitops.installApprovalPlan: {{ .Values.main.gitops.installApprovalPlan }} + gitops.installApprovalPlan: {{ .Values.main.gitops.installApprovalPlan | quote }} {{- end }} {{- if .Values.main.gitops.csv }} - gitops.csv: {{ .Values.main.gitops.csv }} + gitops.csv: {{ .Values.main.gitops.csv | quote }} {{- end }} # gitops.ManualSync: GitOpsDefaultManualSync diff --git a/tests/pattern_operator_configmap_test.yaml b/tests/pattern_operator_configmap_test.yaml index de92b62..f10c5c8 100644 --- a/tests/pattern_operator_configmap_test.yaml +++ b/tests/pattern_operator_configmap_test.yaml @@ -122,7 +122,7 @@ tests: - notExists: path: data["gitops.customHealthChecks"] - - it: Should set gitops.customHealthChecks + - it: Should set gitops.customHealthChecks from a string set: main: gitops: @@ -137,6 +137,17 @@ tests: - exists: path: data["gitops.customHealthChecks"] + - it: Should set gitops.customHealthChecks from a native YAML list + set: + main: + gitops: + customHealthChecks: + - group: example.com + kind: MyKind + asserts: + - exists: + path: data["gitops.customHealthChecks"] + - it: Should not include gitops.sourceNamespace by default asserts: - notExists: @@ -150,7 +161,16 @@ tests: asserts: - equal: path: data["gitops.sourceNamespace"] - value: openshift-marketplace + value: "openshift-marketplace" + + - it: Should quote gitops.sourceNamespace to survive YAML round-trip + set: + main: + gitops: + sourceNamespace: "null" + asserts: + - isNotNull: + path: data["gitops.sourceNamespace"] - it: Should not include gitops.installApprovalPlan by default asserts: @@ -165,7 +185,17 @@ tests: asserts: - equal: path: data["gitops.installApprovalPlan"] - value: Manual + value: "Manual" + + - it: Should quote gitops.installApprovalPlan to survive YAML round-trip + set: + main: + gitops: + installApprovalPlan: "yes" + asserts: + - equal: + path: data["gitops.installApprovalPlan"] + value: "yes" - it: Should not include gitops.csv by default asserts: @@ -180,7 +210,17 @@ tests: asserts: - equal: path: data["gitops.csv"] - value: openshift-gitops-operator.v1.22.0 + value: "openshift-gitops-operator.v1.22.0" + + - it: Should quote gitops.csv to prevent float truncation + set: + main: + gitops: + csv: 1.10 + asserts: + - equal: + path: data["gitops.csv"] + value: "1.1" - it: Should set gitea parameters set: From 3ac1ba79de307cb6e7425106f05f404e936fcc20 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Tue, 10 Nov 2026 09:25:18 +0100 Subject: [PATCH 4/6] Address P2 issues from review --- templates/pattern-operator-configmap.yaml | 12 ++++- tests/pattern_operator_configmap_test.yaml | 52 ++++++++++++++++++++-- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/templates/pattern-operator-configmap.yaml b/templates/pattern-operator-configmap.yaml index 0dc97d2..dff528a 100644 --- a/templates/pattern-operator-configmap.yaml +++ b/templates/pattern-operator-configmap.yaml @@ -22,7 +22,11 @@ data: {{ .Values.main.gitops.customArgoYaml | indent 4 }} {{- end }} {{- if .Values.main.gitops.applicationHealthCheckEnabled }} - gitops.applicationHealthCheckEnabled: {{ .Values.main.gitops.applicationHealthCheckEnabled | quote }} + {{- $ahce := .Values.main.gitops.applicationHealthCheckEnabled | toString | lower }} + {{- if and (ne $ahce "true") (ne $ahce "false") }} + {{- fail "applicationHealthCheckEnabled must be \"true\" or \"false\"" }} + {{- end }} + gitops.applicationHealthCheckEnabled: {{ $ahce | quote }} {{- end }} {{- if .Values.main.gitops.customHealthChecks }} {{- $v := .Values.main.gitops.customHealthChecks }} @@ -33,7 +37,11 @@ data: gitops.sourceNamespace: {{ .Values.main.gitops.sourceNamespace | quote }} {{- end }} {{- if .Values.main.gitops.installApprovalPlan }} - gitops.installApprovalPlan: {{ .Values.main.gitops.installApprovalPlan | quote }} + {{- $iap := .Values.main.gitops.installApprovalPlan | toString }} + {{- if and (ne $iap "Automatic") (ne $iap "Manual") }} + {{- fail "installApprovalPlan must be \"Automatic\" or \"Manual\"" }} + {{- end }} + gitops.installApprovalPlan: {{ $iap | quote }} {{- end }} {{- if .Values.main.gitops.csv }} gitops.csv: {{ .Values.main.gitops.csv | quote }} diff --git a/tests/pattern_operator_configmap_test.yaml b/tests/pattern_operator_configmap_test.yaml index f10c5c8..05f05aa 100644 --- a/tests/pattern_operator_configmap_test.yaml +++ b/tests/pattern_operator_configmap_test.yaml @@ -117,6 +117,34 @@ tests: path: data["gitops.applicationHealthCheckEnabled"] value: "true" + - it: Should accept gitops.applicationHealthCheckEnabled false + set: + main: + gitops: + applicationHealthCheckEnabled: "false" + asserts: + - equal: + path: data["gitops.applicationHealthCheckEnabled"] + value: "false" + + - it: Should reject gitops.applicationHealthCheckEnabled yes + set: + main: + gitops: + applicationHealthCheckEnabled: "yes" + asserts: + - failedTemplate: + errorMessage: "applicationHealthCheckEnabled must be \"true\" or \"false\"" + + - it: Should reject gitops.applicationHealthCheckEnabled 1 + set: + main: + gitops: + applicationHealthCheckEnabled: "1" + asserts: + - failedTemplate: + errorMessage: "applicationHealthCheckEnabled must be \"true\" or \"false\"" + - it: Should not include gitops.customHealthChecks by default asserts: - notExists: @@ -187,15 +215,33 @@ tests: path: data["gitops.installApprovalPlan"] value: "Manual" - - it: Should quote gitops.installApprovalPlan to survive YAML round-trip + - it: Should accept gitops.installApprovalPlan Automatic set: main: gitops: - installApprovalPlan: "yes" + installApprovalPlan: Automatic asserts: - equal: path: data["gitops.installApprovalPlan"] - value: "yes" + value: "Automatic" + + - it: Should reject gitops.installApprovalPlan manual (wrong case) + set: + main: + gitops: + installApprovalPlan: manual + asserts: + - failedTemplate: + errorMessage: "installApprovalPlan must be \"Automatic\" or \"Manual\"" + + - it: Should reject gitops.installApprovalPlan MANUAL (wrong case) + set: + main: + gitops: + installApprovalPlan: MANUAL + asserts: + - failedTemplate: + errorMessage: "installApprovalPlan must be \"Automatic\" or \"Manual\"" - it: Should not include gitops.csv by default asserts: From ea7fdec8073e269a1068680b60068afdfefa61c0 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Tue, 10 Nov 2026 09:29:27 +0100 Subject: [PATCH 5/6] Run helm-docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d45868..af189ee 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # pattern-install -![Version: 0.0.18](https://img.shields.io/badge/Version-0.0.18-informational?style=flat-square) +![Version: 0.0.19](https://img.shields.io/badge/Version-0.0.19-informational?style=flat-square) A Helm chart to build and deploy a Cloud Pattern via the patterns operator @@ -37,9 +37,9 @@ This chart is used by the Validated Patterns installation script that can be fou | main.gitops.applicationHealthCheckEnabled | string | `""` | Set to "true" to have the patterns operator restore the ArgoCD Application resource health check (dropped in ArgoCD 1.8). Required for app-of-apps sync-wave ordering: without it the root Application treats child Applications as healthy and applies all waves at once. The operator defaults this to false, so it must be set explicitly. | | main.gitops.argoRBAC | string | `""` | Full ArgoCD RBAC spec as a YAML string. When set, it completely overrides the default RBAC policy and additionalArgoAdmins is ignored. | | main.gitops.channel | string | `"gitops-1.21"` | Default channel to install the gitops operator from | +| main.gitops.csv | string | `""` | Starting CSV for the gitops operator install. Defaults to the operator's own default. | | main.gitops.customArgoYaml | string | `""` | 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. | | main.gitops.customHealthChecks | string | `""` | Additional resource health checks for the ArgoCD CR, as a YAML list string. Appended to the operator's built-in checks (PVC, Subscription, and Application when applicationHealthCheckEnabled is true). | -| main.gitops.csv | string | `""` | Starting CSV for the gitops operator install. Defaults to the operator's own default. | | main.gitops.installApprovalPlan | string | `""` | Install plan approval mode for the gitops operator subscription (Automatic or Manual). Defaults to the operator's own default. | | main.gitops.operatorSource | string | `"redhat-operators"` | Source to be used to install the gitops operator from | | main.gitops.sourceNamespace | string | `""` | Namespace of the catalog source the gitops operator is installed from. Defaults to the operator's own default (openshift-marketplace). | From f789b05a11786c7dde054d30f475a03a7234b4d7 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Tue, 10 Nov 2026 09:56:55 +0100 Subject: [PATCH 6/6] Make a couple of tests more thorough --- tests/pattern_operator_configmap_test.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/pattern_operator_configmap_test.yaml b/tests/pattern_operator_configmap_test.yaml index 05f05aa..2e78927 100644 --- a/tests/pattern_operator_configmap_test.yaml +++ b/tests/pattern_operator_configmap_test.yaml @@ -162,8 +162,15 @@ tests: hs.status = "Healthy" return hs asserts: - - exists: + - equal: path: data["gitops.customHealthChecks"] + value: | + - group: example.com + kind: MyKind + check: | + hs = {} + hs.status = "Healthy" + return hs - it: Should set gitops.customHealthChecks from a native YAML list set: @@ -173,8 +180,11 @@ tests: - group: example.com kind: MyKind asserts: - - exists: + - equal: path: data["gitops.customHealthChecks"] + value: | + - group: example.com + kind: MyKind - it: Should not include gitops.sourceNamespace by default asserts: