diff --git a/charts/trino/README.md b/charts/trino/README.md index bde6335d..5d729af0 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -86,7 +86,17 @@ Fast distributed SQL query engine for big data analytics that helps you explore * `accessControl` - object, default: `{}` [System access control](https://trino.io/docs/current/security/built-in-system-access-control.html) configuration. - Example: + Set the type property to either: + * `configmap`, and provide the rule file contents in `rules`, + * `properties`, and provide configuration properties in `properties`. + Properties example: + ```yaml + type: properties + properties: | + access-control.name=custom-access-control + access-control.custom_key=custom_value + ``` + Config map example: ```yaml type: configmap refreshPeriod: 60s @@ -680,4 +690,4 @@ Fast distributed SQL query engine for big data analytics that helps you explore * `ingress.tls` - list, default: `[]` ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/charts/trino/templates/configmap-coordinator.yaml b/charts/trino/templates/configmap-coordinator.yaml index a3080cd3..9711c9ee 100644 --- a/charts/trino/templates/configmap-coordinator.yaml +++ b/charts/trino/templates/configmap-coordinator.yaml @@ -80,14 +80,25 @@ data: {{- .Values.server.coordinatorExtraConfig | nindent 4 }} {{- end }} -{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }} +{{- if .Values.accessControl }} + {{- if eq .Values.accessControl.type "configmap" }} access-control.properties: | access-control.name=file {{- if .Values.accessControl.refreshPeriod }} security.refresh-period={{ .Values.accessControl.refreshPeriod }} {{- end }} security.config-file={{ .Values.server.config.path }}/access-control/{{ .Values.accessControl.configFile | default "rules.json" }} -{{- end }}{{- end }} + {{- else if eq .Values.accessControl.type "properties" }} + access-control.properties: | + {{- if .Values.accessControl.properties }} + {{- .Values.accessControl.properties | nindent 4 }} + {{- else}} + {{- fail "accessControl.properties is required when accessControl.type is 'properties'." }} + {{- end }} + {{- else}} + {{- fail "Invalid accessControl.type value. It must be either 'configmap' or 'properties'." }} + {{- end }} +{{- end }} {{- if .Values.resourceGroups }} resource-groups.properties: | diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index f792a4af..7a6e76c6 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -92,7 +92,17 @@ accessControl: {} # control](https://trino.io/docs/current/security/built-in-system-access-control.html) # configuration. # @raw -# Example: +# Set the type property to either: +# * `configmap`, and provide the rule file contents in `rules`, +# * `properties`, and provide configuration properties in `properties`. +# Properties example: +# ```yaml +# type: properties +# properties: | +# access-control.name=custom-access-control +# access-control.custom_key=custom_value +# ``` +# Config map example: # ```yaml # type: configmap # refreshPeriod: 60s diff --git a/test-access-control-properties-values.yaml b/test-access-control-properties-values.yaml new file mode 100644 index 00000000..c1ad9156 --- /dev/null +++ b/test-access-control-properties-values.yaml @@ -0,0 +1,7 @@ +# Access Control 'properties' values to test. +# This is a YAML-formatted file. + +accessControl: + type: properties + properties: | + access-control.name=read-only diff --git a/test.sh b/test.sh index fd058131..25447b6f 100755 --- a/test.sh +++ b/test.sh @@ -7,6 +7,7 @@ declare -A testCases=( [single_node]="--set server.workers=0" [complete_values]="--values test-values.yaml" [overrides]="--set coordinatorNameOverride=coordinator-overridden,workerNameOverride=worker-overridden,nameOverride=overridden" + [access_control_properties_values]="--values test-access-control-properties-values.yaml" ) function join_by { @@ -21,7 +22,7 @@ NAMESPACE=trino-$(LC_ALL=C tr -dc 'a-z0-9' &2