When parsing URIs we use splitList which is defined locally:
|
for _, uriS := range splitList(csv) { |
|
// splitList returns the given csv as a slice. Trims space of each element. |
|
func splitList(csv string) []string { |
|
var list []string |
|
for _, s := range strings.Split(csv, ",") { |
|
list = append(list, strings.TrimSpace(s)) |
|
} |
|
return list |
|
} |
This split function has no support for escaping commas and as such could be invalid for certain URIs which can legally contain commas. Ideally we should use CSV parsing logic instead, which would allow URIs containing commas to be used.
For related discussion in a review of a cert-manager feature, see: cert-manager/cert-manager#4502 (comment)
When parsing URIs we use
splitListwhich is defined locally:csi-driver/pkg/requestgen/generator.go
Line 164 in c94e146
csi-driver/pkg/requestgen/generator.go
Lines 223 to 230 in c94e146
This split function has no support for escaping commas and as such could be invalid for certain URIs which can legally contain commas. Ideally we should use CSV parsing logic instead, which would allow URIs containing commas to be used.
For related discussion in a review of a cert-manager feature, see: cert-manager/cert-manager#4502 (comment)