From 22601d9884462d844c8f1d12a1ff116bdc99a810 Mon Sep 17 00:00:00 2001 From: Zahar Pecherichny Date: Mon, 10 Jun 2024 12:34:42 +0300 Subject: [PATCH] exclude openshift namespaces via regex Signed-off-by: Zahar Pecherichny --- charts/hnc/values.yaml | 4 ++++ hack/helm_patches/update-helm.sh | 3 +++ 2 files changed, 7 insertions(+) diff --git a/charts/hnc/values.yaml b/charts/hnc/values.yaml index 9dcbc7b2d..1302e02f0 100644 --- a/charts/hnc/values.yaml +++ b/charts/hnc/values.yaml @@ -2,6 +2,10 @@ image: repository: gcr.io/k8s-staging-multitenancy/hnc-manager tag: v1.1.0 imagePullPolicy: {} +# Regex of namespaces for HNC to manage +# example include everything except openshift.* +#hncIncludeNamespacesRegex: ([^o].*|o([^p].*)|op([^e].*)|ope([^n].*)|open([^s].*)|opens([^h].*)|opensh([^i].*)|openshi([^f].*)|openshif([^t].*)) +hncIncludeNamespacesRegex: "" # A list of namespaces to add the HNC exclude label to hncExcludeNamespaces: - hnc-system diff --git a/hack/helm_patches/update-helm.sh b/hack/helm_patches/update-helm.sh index 60f404a89..5adc844c9 100755 --- a/hack/helm_patches/update-helm.sh +++ b/hack/helm_patches/update-helm.sh @@ -176,6 +176,9 @@ for output_file in ${TEMPLATESDIR}/*.yaml; do # Add placeholder for --excluded-namespace arg sed -i -e '/args:/a \ {{- range $hncExcludeNamespace := .Values.hncExcludeNamespaces}}\n \ - --excluded-namespace={{ $hncExcludeNamespace }}\n \ {{- end }}' $output_file + # Add placeholder for --included-namespace-regex arg + sed -i -e '/args:/a \ {{- if $hncIncludeNamespacesRegex}}\n \ - --included-namespace-regex={{ $hncIncludeNamespacesRegex }}\n \ {{- end }}' $output_file + # [HRQ] Add conditional blocks for --enable-hrq arg sed -i -e '/args:/a \ {{- if .Values.hrq.enabled }}\n \ - --enable-hrq\n \ {{- end }}' $output_file