From 9a6468135a138a01e7bb3b8f5c4472fca2062515 Mon Sep 17 00:00:00 2001 From: Joe Julian Date: Thu, 2 Nov 2023 15:19:34 -0700 Subject: [PATCH] operator(console): initialize null map before adding entries --- src/go/k8s/pkg/resources/ingress.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/go/k8s/pkg/resources/ingress.go b/src/go/k8s/pkg/resources/ingress.go index 291c3b10b170a..53706853a79de 100644 --- a/src/go/k8s/pkg/resources/ingress.go +++ b/src/go/k8s/pkg/resources/ingress.go @@ -93,6 +93,9 @@ func (r *IngressResource) WithAnnotations( func (r *IngressResource) WithTLS( clusterIssuer, secretName string, ) *IngressResource { + if r.annotations == nil { + r.annotations = make(map[string]string, 2) + } r.annotations["cert-manager.io/cluster-issuer"] = clusterIssuer r.annotations["nginx.ingress.kubernetes.io/force-ssl-redirect"] = trueString