File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,14 @@ func StringToMap(s string) map[string]string {
119119 return m
120120}
121121
122+ // CommaSeparatedStringToSlice transforms a comma-separated string into a slice of strings
123+ func CommaSeparatedStringToSlice (s string ) []string {
124+ if s == "" {
125+ return []string {}
126+ }
127+ return strings .Split (s , "," )
128+ }
129+
122130func init () {
123131 utilruntime .Must (clientgoscheme .AddToScheme (scheme ))
124132 utilruntime .Must (corev1beta1 .AddToScheme (scheme ))
@@ -345,7 +353,7 @@ func main() {
345353 kph := flagdproxy .NewFlagdProxyHandler (
346354 flagdproxy .NewFlagdProxyConfiguration (
347355 env ,
348- strings . Split (imagePullSecrets , "," ),
356+ CommaSeparatedStringToSlice (imagePullSecrets ),
349357 labelsMap ,
350358 annotationsMap ,
351359 ),
@@ -384,9 +392,10 @@ func main() {
384392 Scheme : mgr .GetScheme (),
385393 Log : flagdControllerLogger ,
386394 }
395+
387396 flagdConfig := flagd .NewFlagdConfiguration (
388397 env ,
389- strings . Split (imagePullSecrets , "," ),
398+ CommaSeparatedStringToSlice (imagePullSecrets ),
390399 labelsMap ,
391400 annotationsMap ,
392401 )
You can’t perform that action at this time.
0 commit comments