From 17a263ff23d2efe9ab59bf946c9d55fd07741aeb Mon Sep 17 00:00:00 2001 From: Tomas Turek Date: Mon, 11 Dec 2023 17:37:54 +0100 Subject: [PATCH] RoleBinding will not be genereted if component is dissabled --- charts/trusted-artifact-signer/Chart.yaml | 2 +- charts/trusted-artifact-signer/templates/rolebinding.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/trusted-artifact-signer/Chart.yaml b/charts/trusted-artifact-signer/Chart.yaml index 855709f4..07c1a19a 100644 --- a/charts/trusted-artifact-signer/Chart.yaml +++ b/charts/trusted-artifact-signer/Chart.yaml @@ -33,4 +33,4 @@ sources: # 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: 0.1.26 +version: 0.1.27 diff --git a/charts/trusted-artifact-signer/templates/rolebinding.yaml b/charts/trusted-artifact-signer/templates/rolebinding.yaml index bfecbce9..96952608 100644 --- a/charts/trusted-artifact-signer/templates/rolebinding.yaml +++ b/charts/trusted-artifact-signer/templates/rolebinding.yaml @@ -1,5 +1,6 @@ {{- range $configKey, $config := .Values.configs }} {{- if $config.rolebindings }} +{{- if or (not (hasKey $config "enabled")) (eq $config.enabled true) }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -17,4 +18,5 @@ subjects: namespace: {{ $config.namespace }} {{- end }} {{- end }} +{{- end }} {{- end }} \ No newline at end of file