From 815c5532d210adce03a002bac0a8f2f340281a35 Mon Sep 17 00:00:00 2001 From: Petre Date: Sat, 2 Mar 2024 23:11:44 +0200 Subject: [PATCH] make clusterole name configurable Signed-off-by: Petre --- charts/flux2/Chart.yaml | 2 +- charts/flux2/README.md | 2 +- .../templates/cluster-reconciler-clusterrolebinding.yaml | 2 +- .../tests/__snapshot__/helm-controller_test.yaml.snap | 2 +- .../image-automation-controller_test.yaml.snap | 2 +- .../image-reflector-controller_test.yaml.snap | 2 +- .../kustomize-controller-secret_test.yaml.snap | 2 +- .../__snapshot__/kustomize-controller_test.yaml.snap | 2 +- .../__snapshot__/notification-controller_test.yaml.snap | 2 +- .../tests/__snapshot__/pre-install-job_test.yaml.snap | 4 ++-- .../tests/__snapshot__/source-controller_test.yaml.snap | 2 +- .../cluster-reconciler-clusterrolebinding_test.yaml | 9 ++++++++- charts/flux2/values.yaml | 2 ++ 13 files changed, 22 insertions(+), 13 deletions(-) diff --git a/charts/flux2/Chart.yaml b/charts/flux2/Chart.yaml index d948939..8e37f2c 100644 --- a/charts/flux2/Chart.yaml +++ b/charts/flux2/Chart.yaml @@ -8,4 +8,4 @@ name: flux2 sources: - https://github.com/fluxcd-community/helm-charts type: application -version: 2.12.3 +version: 2.12.4 diff --git a/charts/flux2/README.md b/charts/flux2/README.md index 23d134f..3aa73fa 100644 --- a/charts/flux2/README.md +++ b/charts/flux2/README.md @@ -1,6 +1,6 @@ # flux2 -![Version: 2.12.3](https://img.shields.io/badge/Version-2.12.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.2.3](https://img.shields.io/badge/AppVersion-2.2.3-informational?style=flat-square) +![Version: 2.12.4](https://img.shields.io/badge/Version-2.12.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.2.3](https://img.shields.io/badge/AppVersion-2.2.3-informational?style=flat-square) A Helm chart for flux2 diff --git a/charts/flux2/templates/cluster-reconciler-clusterrolebinding.yaml b/charts/flux2/templates/cluster-reconciler-clusterrolebinding.yaml index 0228c1b..63dc857 100644 --- a/charts/flux2/templates/cluster-reconciler-clusterrolebinding.yaml +++ b/charts/flux2/templates/cluster-reconciler-clusterrolebinding.yaml @@ -15,7 +15,7 @@ metadata: roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: cluster-admin + name: {{ .Values.rbac.roleRef.name }} subjects: - kind: ServiceAccount name: kustomize-controller diff --git a/charts/flux2/tests/__snapshot__/helm-controller_test.yaml.snap b/charts/flux2/tests/__snapshot__/helm-controller_test.yaml.snap index 8a90189..5ae946f 100644 --- a/charts/flux2/tests/__snapshot__/helm-controller_test.yaml.snap +++ b/charts/flux2/tests/__snapshot__/helm-controller_test.yaml.snap @@ -10,7 +10,7 @@ should match snapshot of default values: app.kubernetes.io/part-of: flux app.kubernetes.io/version: 2.2.3 control-plane: controller - helm.sh/chart: flux2-2.12.3 + helm.sh/chart: flux2-2.12.4 labeltestkey: labeltestvalue labeltestkey2: labeltestvalue2 name: helm-controller diff --git a/charts/flux2/tests/__snapshot__/image-automation-controller_test.yaml.snap b/charts/flux2/tests/__snapshot__/image-automation-controller_test.yaml.snap index c6e5b10..473ee3b 100644 --- a/charts/flux2/tests/__snapshot__/image-automation-controller_test.yaml.snap +++ b/charts/flux2/tests/__snapshot__/image-automation-controller_test.yaml.snap @@ -10,7 +10,7 @@ should match snapshot of default values: app.kubernetes.io/part-of: flux app.kubernetes.io/version: 2.2.3 control-plane: controller - helm.sh/chart: flux2-2.12.3 + helm.sh/chart: flux2-2.12.4 name: image-automation-controller spec: replicas: 1 diff --git a/charts/flux2/tests/__snapshot__/image-reflector-controller_test.yaml.snap b/charts/flux2/tests/__snapshot__/image-reflector-controller_test.yaml.snap index e331083..7cb9a38 100644 --- a/charts/flux2/tests/__snapshot__/image-reflector-controller_test.yaml.snap +++ b/charts/flux2/tests/__snapshot__/image-reflector-controller_test.yaml.snap @@ -10,7 +10,7 @@ should match snapshot of default values: app.kubernetes.io/part-of: flux app.kubernetes.io/version: 2.2.3 control-plane: controller - helm.sh/chart: flux2-2.12.3 + helm.sh/chart: flux2-2.12.4 name: image-reflector-controller spec: replicas: 1 diff --git a/charts/flux2/tests/__snapshot__/kustomize-controller-secret_test.yaml.snap b/charts/flux2/tests/__snapshot__/kustomize-controller-secret_test.yaml.snap index 1169569..e1d8968 100644 --- a/charts/flux2/tests/__snapshot__/kustomize-controller-secret_test.yaml.snap +++ b/charts/flux2/tests/__snapshot__/kustomize-controller-secret_test.yaml.snap @@ -10,7 +10,7 @@ should match snapshot of default values: app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: flux app.kubernetes.io/version: 2.2.3 - helm.sh/chart: flux2-2.12.3 + helm.sh/chart: flux2-2.12.4 name: test1 namespace: NAMESPACE type: Opaque diff --git a/charts/flux2/tests/__snapshot__/kustomize-controller_test.yaml.snap b/charts/flux2/tests/__snapshot__/kustomize-controller_test.yaml.snap index 849e8fe..5ecf089 100644 --- a/charts/flux2/tests/__snapshot__/kustomize-controller_test.yaml.snap +++ b/charts/flux2/tests/__snapshot__/kustomize-controller_test.yaml.snap @@ -10,7 +10,7 @@ should match snapshot of default values: app.kubernetes.io/part-of: flux app.kubernetes.io/version: 2.2.3 control-plane: controller - helm.sh/chart: flux2-2.12.3 + helm.sh/chart: flux2-2.12.4 name: kustomize-controller spec: replicas: 1 diff --git a/charts/flux2/tests/__snapshot__/notification-controller_test.yaml.snap b/charts/flux2/tests/__snapshot__/notification-controller_test.yaml.snap index fcae707..fa6ec63 100644 --- a/charts/flux2/tests/__snapshot__/notification-controller_test.yaml.snap +++ b/charts/flux2/tests/__snapshot__/notification-controller_test.yaml.snap @@ -10,7 +10,7 @@ should match snapshot of default values: app.kubernetes.io/part-of: flux app.kubernetes.io/version: 2.2.3 control-plane: controller - helm.sh/chart: flux2-2.12.3 + helm.sh/chart: flux2-2.12.4 name: notification-controller spec: replicas: 1 diff --git a/charts/flux2/tests/__snapshot__/pre-install-job_test.yaml.snap b/charts/flux2/tests/__snapshot__/pre-install-job_test.yaml.snap index cf5da98..7fff892 100644 --- a/charts/flux2/tests/__snapshot__/pre-install-job_test.yaml.snap +++ b/charts/flux2/tests/__snapshot__/pre-install-job_test.yaml.snap @@ -12,7 +12,7 @@ should match snapshot of default values: app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: flux app.kubernetes.io/version: 2.2.3 - helm.sh/chart: flux2-2.12.3 + helm.sh/chart: flux2-2.12.4 name: RELEASE-NAME-flux-check spec: backoffLimit: 1 @@ -23,7 +23,7 @@ should match snapshot of default values: app.kubernetes.io/managed-by: Helm app.kubernetes.io/part-of: flux app.kubernetes.io/version: 2.2.3 - helm.sh/chart: flux2-2.12.3 + helm.sh/chart: flux2-2.12.4 name: RELEASE-NAME spec: automountServiceAccountToken: true diff --git a/charts/flux2/tests/__snapshot__/source-controller_test.yaml.snap b/charts/flux2/tests/__snapshot__/source-controller_test.yaml.snap index 4a253f4..bd94c95 100644 --- a/charts/flux2/tests/__snapshot__/source-controller_test.yaml.snap +++ b/charts/flux2/tests/__snapshot__/source-controller_test.yaml.snap @@ -10,7 +10,7 @@ should match snapshot of default values: app.kubernetes.io/part-of: flux app.kubernetes.io/version: 2.2.3 control-plane: controller - helm.sh/chart: flux2-2.12.3 + helm.sh/chart: flux2-2.12.4 name: source-controller spec: replicas: 1 diff --git a/charts/flux2/tests/cluster-reconciler-clusterrolebinding_test.yaml b/charts/flux2/tests/cluster-reconciler-clusterrolebinding_test.yaml index 184b900..69c2302 100644 --- a/charts/flux2/tests/cluster-reconciler-clusterrolebinding_test.yaml +++ b/charts/flux2/tests/cluster-reconciler-clusterrolebinding_test.yaml @@ -37,4 +37,11 @@ tests: - equal: path: metadata.annotations value: - helm.sh/resource-policy: keep \ No newline at end of file + helm.sh/resource-policy: keep + - it: should set clusterrole name + set: + rbac.roleRef.name: test-clusterrole + asserts: + - equal: + path: roleRef.name + value: test-clusterrole diff --git a/charts/flux2/values.yaml b/charts/flux2/values.yaml index 6b23719..379c07e 100644 --- a/charts/flux2/values.yaml +++ b/charts/flux2/values.yaml @@ -278,6 +278,8 @@ rbac: createAggregation: true # -- Add annotations to all RBAC resources, e.g. "helm.sh/resource-policy": keep annotations: {} + roleRef: + name: cluster-admin logLevel: info watchAllNamespaces: true