From d262cb6555088b2021d64da84d5e3b2e35dcc529 Mon Sep 17 00:00:00 2001 From: Michel Thebeau Date: Mon, 13 Jan 2025 16:01:08 -0500 Subject: [PATCH] update includeConfigAnnotation to match README/values The value of server.includeConfigAnnotation is presented in the README.md and values.yaml as server.configAnnotation. Update the server configmap, _helpers.tpl and unit tests to align with the documentation. Signed-off-by: Michel Thebeau --- charts/openbao/templates/_helpers.tpl | 2 +- charts/openbao/templates/server-config-configmap.yaml | 2 +- test/unit/server-configmap.bats | 2 +- test/unit/server-statefulset.bats | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/openbao/templates/_helpers.tpl b/charts/openbao/templates/_helpers.tpl index 0d88f5e2e..9561909a2 100644 --- a/charts/openbao/templates/_helpers.tpl +++ b/charts/openbao/templates/_helpers.tpl @@ -448,7 +448,7 @@ Sets extra pod annotations */}} {{- define "openbao.annotations" }} annotations: - {{- if .Values.server.includeConfigAnnotation }} + {{- if .Values.server.configAnnotation }} openbao.hashicorp.com/config-checksum: {{ include "openbao.config" . | sha256sum }} {{- end }} {{- if .Values.server.annotations }} diff --git a/charts/openbao/templates/server-config-configmap.yaml b/charts/openbao/templates/server-config-configmap.yaml index 585ae7a9a..57c4b0e68 100644 --- a/charts/openbao/templates/server-config-configmap.yaml +++ b/charts/openbao/templates/server-config-configmap.yaml @@ -18,7 +18,7 @@ metadata: app.kubernetes.io/name: {{ include "openbao.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.server.includeConfigAnnotation }} +{{- if .Values.server.configAnnotation }} annotations: vault.hashicorp.com/config-checksum: {{ include "openbao.config" . | sha256sum }} {{- end }} diff --git a/test/unit/server-configmap.bats b/test/unit/server-configmap.bats index 55d67e93c..aa34edc04 100755 --- a/test/unit/server-configmap.bats +++ b/test/unit/server-configmap.bats @@ -153,7 +153,7 @@ load _helpers cd `chart_dir` local actual=$(helm template \ --show-only templates/server-config-configmap.yaml \ - --set 'server.includeConfigAnnotation=true' \ + --set 'server.configAnnotation=true' \ . | tee /dev/stderr | yq '.metadata.annotations["vault.hashicorp.com/config-checksum"] == null' | tee /dev/stderr) [ "${actual}" = "false" ] diff --git a/test/unit/server-statefulset.bats b/test/unit/server-statefulset.bats index 9a4bf3ef9..f089252b9 100755 --- a/test/unit/server-statefulset.bats +++ b/test/unit/server-statefulset.bats @@ -1636,7 +1636,7 @@ load _helpers cd `chart_dir` local actual=$(helm template \ --show-only templates/server-statefulset.yaml \ - --set 'server.includeConfigAnnotation=true' \ + --set 'server.configAnnotation=true' \ . | tee /dev/stderr | yq '.spec.template.metadata.annotations["openbao.hashicorp.com/config-checksum"] == null' | tee /dev/stderr) [ "${actual}" = "false" ]