From a29b3553382726a446cef7c985ab96c6e95e98b9 Mon Sep 17 00:00:00 2001 From: nzbr Date: Wed, 27 Mar 2024 17:09:49 +0100 Subject: [PATCH] Use CSV split function instead of strings.Split Signed-off-by: nzbr --- pkg/requestgen/generator.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/requestgen/generator.go b/pkg/requestgen/generator.go index e55dfb33..e69e7d4f 100644 --- a/pkg/requestgen/generator.go +++ b/pkg/requestgen/generator.go @@ -29,6 +29,7 @@ import ( cmapi "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1" cmmeta "github.com/cert-manager/cert-manager/pkg/apis/meta/v1" + cmutil "github.com/cert-manager/cert-manager/pkg/util" cmpki "github.com/cert-manager/cert-manager/pkg/util/pki" "github.com/cert-manager/csi-lib/manager" "github.com/cert-manager/csi-lib/metadata" @@ -95,7 +96,10 @@ func RequestForMetadata(meta metadata.Metadata) (*manager.CertificateRequestBund if err != nil { return nil, fmt.Errorf("%q: %w", v, err) } - *k = strings.Split(e, ",") + *k, err = cmutil.SplitWithEscapeCSV(e) + if err != nil { + return nil, fmt.Errorf("%q: %w", v, err) + } } } }