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 {
119
119
return m
120
120
}
121
121
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
+
122
130
func init () {
123
131
utilruntime .Must (clientgoscheme .AddToScheme (scheme ))
124
132
utilruntime .Must (corev1beta1 .AddToScheme (scheme ))
@@ -345,7 +353,7 @@ func main() {
345
353
kph := flagdproxy .NewFlagdProxyHandler (
346
354
flagdproxy .NewFlagdProxyConfiguration (
347
355
env ,
348
- strings . Split (imagePullSecrets , "," ),
356
+ CommaSeparatedStringToSlice (imagePullSecrets ),
349
357
labelsMap ,
350
358
annotationsMap ,
351
359
),
@@ -384,9 +392,10 @@ func main() {
384
392
Scheme : mgr .GetScheme (),
385
393
Log : flagdControllerLogger ,
386
394
}
395
+
387
396
flagdConfig := flagd .NewFlagdConfiguration (
388
397
env ,
389
- strings . Split (imagePullSecrets , "," ),
398
+ CommaSeparatedStringToSlice (imagePullSecrets ),
390
399
labelsMap ,
391
400
annotationsMap ,
392
401
)
You can’t perform that action at this time.
0 commit comments