From 78a55528559e64e7797b11e1021532b0759f3a39 Mon Sep 17 00:00:00 2001 From: Alexander Rashed Date: Fri, 18 Oct 2024 09:45:30 +0200 Subject: [PATCH] properly include extraRoles --- README.md | 1 - charts/localstack/templates/role.yaml | 9 +-------- charts/localstack/test-values.yaml | 8 ++++++++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 15b5f40..08a5b3e 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,6 @@ Example: ```yaml role: - create: true extraRoles: - apiGroups: ["security.openshift.io"] resources: ["securitycontextconstraints"] diff --git a/charts/localstack/templates/role.yaml b/charts/localstack/templates/role.yaml index 507905c..3abc6b0 100644 --- a/charts/localstack/templates/role.yaml +++ b/charts/localstack/templates/role.yaml @@ -20,14 +20,7 @@ rules: resources: ["services"] verbs: ["get", "list"] {{- if .Values.role.extraRoles }} - {{- range .Values.role.extraRoles }} -- apiGroups: {{ toJson .apiGroups | nindent 2 }} - resources: {{ toJson .resources | nindent 2 }} - {{- if .resourceNames }} - resourceNames: {{ toJson .resourceNames | nindent 2 }} - {{- end }} - verbs: {{ toJson .verbs | nindent 2 }} - {{- end }} +{{ include "common.tplvalues.render" (dict "value" .Values.role.extraRoles "context" $) }} {{- end }} {{- end }} diff --git a/charts/localstack/test-values.yaml b/charts/localstack/test-values.yaml index 3c7a456..5c42114 100644 --- a/charts/localstack/test-values.yaml +++ b/charts/localstack/test-values.yaml @@ -57,3 +57,11 @@ ingress: # enable kubernetes lambda executor (only pro) # lambda: # executor: "kubernetes" + +# add extra roles for OpenShift +# role: +# extraRoles: +# - apiGroups: ["security.openshift.io"] +# resources: ["securitycontextconstraints"] +# resourceNames: ["anyuid"] +# verbs: ["use"] \ No newline at end of file