From f3ba780ab52f845fe0bdc896bb19f4429f2a8993 Mon Sep 17 00:00:00 2001 From: Arnar Date: Mon, 17 Oct 2022 21:36:22 +0200 Subject: [PATCH] Alphabetically sort list of super users (#291) Fixes #288 ### Motivation When specifying multiple roles in `.Values.auth.superUsers` the values are converted to a comma-separated list by piping the dict through `values` and `join` in helm templating, `values` however doesn't guarantee that the order of elements will be the same every time. Therefor it recommends also passing it through `sortAlpha` to sort the list alphabetically. This is a problematic when `.Values.broker.restartPodsOnConfigMapChange` is enabled because the checksum of the configmap changes every time the list's order is changed, resulting in the statefulsets rolling out a new version of the pods. ### Modifications Pass list through `sortAlpha`. ### Verifying this change - [x] Make sure that the change passes the CI checks. --- charts/pulsar/templates/broker-configmap.yaml | 2 +- charts/pulsar/templates/proxy-configmap.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/pulsar/templates/broker-configmap.yaml b/charts/pulsar/templates/broker-configmap.yaml index b67e5a8..10077d4 100644 --- a/charts/pulsar/templates/broker-configmap.yaml +++ b/charts/pulsar/templates/broker-configmap.yaml @@ -110,7 +110,7 @@ data: authenticationEnabled: "true" {{- if .Values.auth.authorization.enabled }} authorizationEnabled: "true" - superUserRoles: {{ .Values.auth.superUsers | values | join "," }} + superUserRoles: {{ .Values.auth.superUsers | values | sortAlpha | join "," }} {{- end }} {{- if eq .Values.auth.authentication.provider "jwt" }} # token authentication configuration diff --git a/charts/pulsar/templates/proxy-configmap.yaml b/charts/pulsar/templates/proxy-configmap.yaml index 66ea48d..71a7eff 100644 --- a/charts/pulsar/templates/proxy-configmap.yaml +++ b/charts/pulsar/templates/proxy-configmap.yaml @@ -64,7 +64,7 @@ data: # disable authorization on proxy and forward authorization credentials to broker authorizationEnabled: "false" forwardAuthorizationCredentials: "true" - superUserRoles: {{ .Values.auth.superUsers | values | join "," }} + superUserRoles: {{ .Values.auth.superUsers | values | sortAlpha | join "," }} {{- end }} {{- if eq .Values.auth.authentication.provider "jwt" }} # token authentication configuration