From 02b6f722150c8fedcbd67e41600213e4eb55b134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20No=C3=ABl?= Date: Tue, 17 Mar 2026 10:57:41 -0700 Subject: [PATCH 1/2] fix(monitoring): guard against nil pointer in pooler PodMonitor template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a pooler defines `monitoring.enabled: true` without a `podMonitor` sub-key, the template panics with a nil pointer error because Go templates evaluate all arguments to `and` before calling the function. Replace the single `and` chain with nested `if` blocks so that `.monitoring.podMonitor.enabled` is only evaluated when `.monitoring.podMonitor` is confirmed to be non-nil. Signed-off-by: Philippe Noël --- charts/cluster/templates/podmonitor-pooler.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/cluster/templates/podmonitor-pooler.yaml b/charts/cluster/templates/podmonitor-pooler.yaml index c8f1490545..dbf810febd 100644 --- a/charts/cluster/templates/podmonitor-pooler.yaml +++ b/charts/cluster/templates/podmonitor-pooler.yaml @@ -1,6 +1,9 @@ {{- range .Values.poolers }} +{{- if .monitoring }} +{{- if .monitoring.enabled }} +{{- if .monitoring.podMonitor }} +{{- if .monitoring.podMonitor.enabled }} --- -{{- if and .monitoring .monitoring.enabled .monitoring.podMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: @@ -35,3 +38,6 @@ spec: {{- end }} {{- end }} {{- end }} +{{- end }} +{{- end }} +{{- end }} From 6169165fd63faf7a4ea63a8e1e3eb81f16ab68ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20No=C3=ABl?= Date: Tue, 17 Mar 2026 14:13:33 -0700 Subject: [PATCH 2/2] fix(test): assert readyInstances in monitoring test to prevent flakiness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without asserting on status.readyInstances, the Chainsaw test can pass the Cluster assertion before all instances are ready, causing subsequent steps to fail intermittently. Signed-off-by: Philippe Noël --- .../cluster/test/monitoring/01-monitoring_cluster-assert.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/cluster/test/monitoring/01-monitoring_cluster-assert.yaml b/charts/cluster/test/monitoring/01-monitoring_cluster-assert.yaml index ee4f9ea19a..d2b15356f1 100644 --- a/charts/cluster/test/monitoring/01-monitoring_cluster-assert.yaml +++ b/charts/cluster/test/monitoring/01-monitoring_cluster-assert.yaml @@ -17,6 +17,8 @@ spec: - name: monitoring-cluster-monitoring key: custom-queries enablePodMonitor: false +status: + readyInstances: 2 --- apiVersion: monitoring.coreos.com/v1 kind: PodMonitor