yannh / kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Apache License 2.0
2.27k stars 123 forks source link

Sanitize csv strings #258

Closed PatDyn closed 6 months ago

PatDyn commented 10 months ago

This should be a simple fix to #256

Two additional test cases were implemented to check some cases of possible input value patterns. The fix itself is realized within the splitCSV function, which now by default replaces all " " by "".

I'm aware, that this might not be the most suitable place for this fix. I thought of implementing it in one of the higher level function but was not sure about implications.

Feel free to comment of course :)

yannh commented 6 months ago

This needs to be fixed and thanks for the contribution! I think I would prefer splitting on , first, and then calling https://pkg.go.dev/strings#TrimSpace on the elements. I might come back to this soon, I'd like this to be fixed :bow:

yannh commented 6 months ago

Merged, thank you!