From d7074ff159a0eb01a569fd420c87402a07cf9313 Mon Sep 17 00:00:00 2001 From: nilsorbat Date: Tue, 17 Oct 2023 16:42:33 +0200 Subject: [PATCH] avoid annotation/label panic with empty maps --- pkg/apis/minio.min.io/v2/helper.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/apis/minio.min.io/v2/helper.go b/pkg/apis/minio.min.io/v2/helper.go index 0055884f9ee..ba2eb9cc2cc 100644 --- a/pkg/apis/minio.min.io/v2/helper.go +++ b/pkg/apis/minio.min.io/v2/helper.go @@ -907,6 +907,12 @@ func GetClusterDomain() string { // MergeMaps merges two maps and returns the union func MergeMaps(a, b map[string]string) map[string]string { + if a == nil { + a = map[string]string{} + } + if b == nil { + b = map[string]string{} + } for k, v := range b { a[k] = v }