From 3876e5c53e9b6b83738946769b829250964cf1c0 Mon Sep 17 00:00:00 2001 From: Dario Tislar <20690019+dac73@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:52:54 +0100 Subject: [PATCH 1/2] Fix .Values scoping issue in namespaced-role.yaml --- mirrord-operator/Chart.yaml | 2 +- mirrord-operator/templates/namespaced-role.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mirrord-operator/Chart.yaml b/mirrord-operator/Chart.yaml index cd25cb6..b102c6b 100644 --- a/mirrord-operator/Chart.yaml +++ b/mirrord-operator/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.11.0 +version: 1.11.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/mirrord-operator/templates/namespaced-role.yaml b/mirrord-operator/templates/namespaced-role.yaml index e926d0c..17f0a13 100644 --- a/mirrord-operator/templates/namespaced-role.yaml +++ b/mirrord-operator/templates/namespaced-role.yaml @@ -6,8 +6,8 @@ metadata: namespace: {{.}} labels: {{- include "mirrord-operator.labels" $ | nindent 4 }} - {{- if index .Values.role "mirrord-operator-user" "labels" }} - {{- toYaml (index .Values.role "mirrord-operator-user" "labels") | nindent 4 }} + {{- if index $ "Values.role" "mirrord-operator-user" "labels" }} + {{- toYaml (index $ "Values.role" "mirrord-operator-user" "labels") | nindent 4 }} {{- end }} rules: {{- include "mirrord-operator.rules" . | nindent 0 }} From 2618beb5882ee1994384d482d2d0ed37065872fd Mon Sep 17 00:00:00 2001 From: Dario Tislar <20690019+dac73@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:45:41 +0100 Subject: [PATCH 2/2] add test --- mirrord-operator/templates/namespaced-role.yaml | 4 ++-- test_values/operator_rolenamespaces.yaml | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 test_values/operator_rolenamespaces.yaml diff --git a/mirrord-operator/templates/namespaced-role.yaml b/mirrord-operator/templates/namespaced-role.yaml index 17f0a13..512bca2 100644 --- a/mirrord-operator/templates/namespaced-role.yaml +++ b/mirrord-operator/templates/namespaced-role.yaml @@ -6,8 +6,8 @@ metadata: namespace: {{.}} labels: {{- include "mirrord-operator.labels" $ | nindent 4 }} - {{- if index $ "Values.role" "mirrord-operator-user" "labels" }} - {{- toYaml (index $ "Values.role" "mirrord-operator-user" "labels") | nindent 4 }} + {{- if index $.Values.role "mirrord-operator-user" "labels" }} + {{- toYaml (index $.Values.role "mirrord-operator-user" "labels") | nindent 4 }} {{- end }} rules: {{- include "mirrord-operator.rules" . | nindent 0 }} diff --git a/test_values/operator_rolenamespaces.yaml b/test_values/operator_rolenamespaces.yaml new file mode 100644 index 0000000..47cac3b --- /dev/null +++ b/test_values/operator_rolenamespaces.yaml @@ -0,0 +1,9 @@ +license: + file: + secret: mirrord-operator-license + data: + license.pem: "DOESN'TNEEDTOBOOTSOITCANBEINVALID" + +roleNamespaces: + - namespace1 + - namespace2