From 30d4f27a88d7718fe91cf14cbcb9c9f09a27cff1 Mon Sep 17 00:00:00 2001 From: steiler Date: Mon, 9 Oct 2023 14:39:02 +0200 Subject: [PATCH] fix: insecureRegistry (cherry picked from commit a2dba2d08d7700250a949cfc0740bd36b805ece6) --- clabverter/clabverter.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clabverter/clabverter.go b/clabverter/clabverter.go index d6cd3056..0d901bb4 100644 --- a/clabverter/clabverter.go +++ b/clabverter/clabverter.go @@ -49,13 +49,19 @@ func MustNewClabverter( logLevel, ) + // trim insecureRegistries and split into array if not empty + var insecureRegistriesArr []string + if len(strings.TrimSpace(insecureRegistries)) > 0 { + insecureRegistriesArr = strings.Split(insecureRegistries, ",") + } + return &Clabverter{ logger: clabverterLogger, topologyFile: topologyFile, outputDirectory: outputDirectory, stdout: stdout, destinationNamespace: destinationNamespace, - insecureRegistries: strings.Split(insecureRegistries, ","), + insecureRegistries: insecureRegistriesArr, startupConfigConfigMaps: make(map[string]topologyConfigMapTemplateVars), extraFilesConfigMaps: make(map[string][]topologyConfigMapTemplateVars), renderedFiles: []renderedContent{},