From d65039a51eb2e03274538bad9fd2a5f63f0f51a9 Mon Sep 17 00:00:00 2001 From: Andrea Pilo <48203828+apiloqbc@users.noreply.github.com> Date: Wed, 4 Mar 2026 10:02:41 +0100 Subject: [PATCH] [bitnami/nginx] feat: add checksum annotation for existingServerBlockConfigmap via lookup (#36470) * feat(nginx): add checksum annotation for existingServerBlockConfigmap When existingServerBlockConfigmap or existingStreamServerBlockConfigmap are set, use helm lookup to read the ConfigMap from the cluster and compute a checksum annotation on the pod template. This triggers a rolling restart whenever the referenced ConfigMap content changes, consistent with the behavior already provided for inline serverBlock. Also fix a copy-paste error: the stream server block checksum condition was checking existingServerBlockConfigmap instead of existingStreamServerBlockConfigmap. Note: lookup returns nil during helm template (offline dry-run), so the annotation is silently omitted in that case. This is expected and consistent with how lookup behaves across all Helm charts. Signed-off-by: Andrea Pilo * Update CHANGELOG.md Signed-off-by: Bitnami Bot --------- Signed-off-by: Andrea Pilo Signed-off-by: Bitnami Bot Co-authored-by: Bitnami Bot --- bitnami/nginx/CHANGELOG.md | 7 ++++++- bitnami/nginx/Chart.yaml | 2 +- bitnami/nginx/templates/deployment.yaml | 14 +++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/bitnami/nginx/CHANGELOG.md b/bitnami/nginx/CHANGELOG.md index 0f4ed45f1d..492f994910 100644 --- a/bitnami/nginx/CHANGELOG.md +++ b/bitnami/nginx/CHANGELOG.md @@ -1,8 +1,13 @@ # Changelog +## 22.1.1 (2026-02-23) + +* [bitnami/nginx] feat: add checksum annotation for existingServerBlockConfigmap via lookup ([#36470](https://github.com/bitnami/charts/pull/36470)) + ## 22.1.0 (2025-10-01) -* [bitnami/nginx] allow to change probes for metrics container ([#36296](https://github.com/bitnami/charts/pull/36296)) +* [bitnami/*] Remove annotations.category (#36224) ([2abc0f9](https://github.com/bitnami/charts/commit/2abc0f9d7e89a5453e57f029c66f581b3d5855ef)), closes [#36224](https://github.com/bitnami/charts/issues/36224) +* [bitnami/nginx] allow to change probes for metrics container (#36296) ([e044aec](https://github.com/bitnami/charts/commit/e044aecf0bfede5c2a12eb0ecb920cd5ef11b82d)), closes [#36296](https://github.com/bitnami/charts/issues/36296) ## 21.1.23 (2025-08-18) diff --git a/bitnami/nginx/Chart.yaml b/bitnami/nginx/Chart.yaml index ad8759342a..98e7a1e4b4 100644 --- a/bitnami/nginx/Chart.yaml +++ b/bitnami/nginx/Chart.yaml @@ -36,4 +36,4 @@ maintainers: name: nginx sources: - https://github.com/bitnami/charts/tree/main/bitnami/nginx -version: 22.1.0 +version: 22.1.1 diff --git a/bitnami/nginx/templates/deployment.yaml b/bitnami/nginx/templates/deployment.yaml index 8d1b9edfb4..5e982a6f41 100644 --- a/bitnami/nginx/templates/deployment.yaml +++ b/bitnami/nginx/templates/deployment.yaml @@ -36,9 +36,21 @@ spec: {{- if and .Values.serverBlock (not .Values.existingServerBlockConfigmap) }} checksum/server-block-configuration: {{ include (print $.Template.BasePath "/server-block-configmap.yaml") . | sha256sum }} {{- end }} - {{- if and .Values.streamServerBlock (not .Values.existingServerBlockConfigmap) }} + {{- if .Values.existingServerBlockConfigmap }} + {{- $existingCM := lookup "v1" "ConfigMap" (include "common.names.namespace" .) .Values.existingServerBlockConfigmap }} + {{- if $existingCM }} + checksum/server-block-configuration: {{ $existingCM.data | toYaml | sha256sum }} + {{- end }} + {{- end }} + {{- if and .Values.streamServerBlock (not .Values.existingStreamServerBlockConfigmap) }} checksum/stream-server-block-configuration: {{ include (print $.Template.BasePath "/stream-server-block-configmap.yaml") . | sha256sum }} {{- end }} + {{- if .Values.existingStreamServerBlockConfigmap }} + {{- $existingStreamCM := lookup "v1" "ConfigMap" (include "common.names.namespace" .) .Values.existingStreamServerBlockConfigmap }} + {{- if $existingStreamCM }} + checksum/stream-server-block-configuration: {{ $existingStreamCM.data | toYaml | sha256sum }} + {{- end }} + {{- end }} {{- if or .Values.contextIncludes.main .Values.contextIncludes.events .Values.contextIncludes.http }} checksum/context-includes-configuration: {{ include (print $.Template.BasePath "/context-includes-configmap.yaml") . | sha256sum }} {{- end }}