From aed45fcaa0a980e42ddde47fcda413a5e4efe38b Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Mon, 26 Jan 2026 11:35:11 +0100 Subject: [PATCH] Add the ability to customize the MultiClusterHub spec --- templates/multiclusterhub.yaml | 3 ++- tests/multiclusterhub_test.yaml | 36 +++++++++++++++++++++++++++++++++ values.yaml | 3 +++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/templates/multiclusterhub.yaml b/templates/multiclusterhub.yaml index a4e8b89..d8fc529 100644 --- a/templates/multiclusterhub.yaml +++ b/templates/multiclusterhub.yaml @@ -10,4 +10,5 @@ metadata: annotations: argocd.argoproj.io/sync-wave: "-1" installer.open-cluster-management.io/mce-subscription-spec: '{"source": "{{ default "redhat-operators" .Values.acm.mce_operator.source }}" {{- $channel }} }' -spec: {} +spec: +{{ .Values.acm.mch_spec | toYaml | indent 2 }} diff --git a/tests/multiclusterhub_test.yaml b/tests/multiclusterhub_test.yaml index ac926df..f0c4f9c 100644 --- a/tests/multiclusterhub_test.yaml +++ b/tests/multiclusterhub_test.yaml @@ -42,3 +42,39 @@ tests: - equal: path: metadata.annotations["installer.open-cluster-management.io/mce-subscription-spec"] value: '{"source": "foo-source","channel": "foo-channel" }' + + - it: Should have empty spec by default + asserts: + - equal: + path: spec + value: {} + + - it: Should set custom spec when mch_spec is provided + set: + acm: + mch_spec: + disableHubSelfManagement: true + availabilityConfig: High + asserts: + - equal: + path: spec.disableHubSelfManagement + value: true + - equal: + path: spec.availabilityConfig + value: High + + - it: Should set nested spec properties when mch_spec has nested values + set: + acm: + mch_spec: + overrides: + components: + - name: cluster-backup + enabled: true + asserts: + - equal: + path: spec.overrides.components[0].name + value: cluster-backup + - equal: + path: spec.overrides.components[0].enabled + value: true diff --git a/values.yaml b/values.yaml index 29520ff..d5c436a 100644 --- a/values.yaml +++ b/values.yaml @@ -63,6 +63,9 @@ clusterGroup: # value: region-two acm: + # @default -- MultiClusterHub spec (empty by default) + mch_spec: {} + # -- Just used for IIB testing, drives the source and channel for the MCE subscription triggered by ACM # @default -- Uses the official redhat sources mce_operator: