From 627022972d7937204f0e402d49e956c899141ef0 Mon Sep 17 00:00:00 2001 From: Isaiah Olson Date: Wed, 5 Nov 2025 18:12:05 -0600 Subject: [PATCH] Use dig function to check for existing secret in NATS app template and prevent nil indexing Signed-off-by: Isaiah Olson --- packages/apps/nats/templates/nats.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/apps/nats/templates/nats.yaml b/packages/apps/nats/templates/nats.yaml index 02209377..b05c87b5 100644 --- a/packages/apps/nats/templates/nats.yaml +++ b/packages/apps/nats/templates/nats.yaml @@ -3,7 +3,7 @@ {{- $existingSecret := lookup "v1" "Secret" .Release.Namespace (printf "%s-credentials" .Release.Name) }} {{- $passwords := dict }} -{{- with (index $existingSecret "data") }} +{{- with (dig "data" (dict) $existingSecret) }} {{- range $k, $v := . }} {{- $_ := set $passwords $k (b64dec $v) }} {{- end }}