From 7219ae530e67153ac3ee2630ad2d89916340e725 Mon Sep 17 00:00:00 2001 From: Mathieu Parent Date: Sat, 19 Aug 2023 16:39:11 +0200 Subject: [PATCH] helm: allow to configure statement policy effect (#17700) Signed-off-by: Mathieu Parent --- helm/minio/templates/_helper_policy.tpl | 4 ++-- helm/minio/values.yaml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/helm/minio/templates/_helper_policy.tpl b/helm/minio/templates/_helper_policy.tpl index f2150530b..8be998e5d 100644 --- a/helm/minio/templates/_helper_policy.tpl +++ b/helm/minio/templates/_helper_policy.tpl @@ -5,7 +5,7 @@ "Statement": [ {{- range $i, $statement := .statements }} { - "Effect": "Allow", + "Effect": "{{ $statement.effect | default "Allow" }}", "Action": [ "{{ $statement.actions | join "\",\n\"" }}" ]{{ if $statement.resources }}, @@ -21,7 +21,7 @@ {{- range $operator,$object := $v }} "{{ $operator }}": { {{ $object }} }{{- if lt $k $condition_len }},{{- end }} {{- end }}{{- end }} - }{{- end }} + }{{- end }} }{{ if lt $i $statements_length }},{{end }} {{- end }} ] diff --git a/helm/minio/values.yaml b/helm/minio/values.yaml index e7a8acc44..55c7bec98 100644 --- a/helm/minio/values.yaml +++ b/helm/minio/values.yaml @@ -273,7 +273,8 @@ policies: [] ## example. # - name: writeexamplepolicy # statements: -# - resources: +# - effect: Allow # this is the default +# resources: # - 'arn:aws:s3:::example*/*' # actions: # - "s3:AbortMultipartUpload"