k8s-device-plugin icon indicating copy to clipboard operation
k8s-device-plugin copied to clipboard

use the helm quote function to wrap helm values in quotes

Open tariq1890 opened this issue 10 months ago • 1 comments

It's generally recommended to use the quote function instead of explicitly wrapping helm values with quotes in-line

tariq1890 avatar Apr 12 '24 22:04 tariq1890

I'm not necessarily opposed to this, just curious is there there is any magic going on with doing things this way. Do all double quotes within the string being passed to quote get escaped, for example?

klueska avatar Apr 15 '24 11:04 klueska

@klueska This is one of the best practices of helm. I also think it's more readable as it is explicit in its intent to wrap a string in quotes when using templates

Do all double quotes within the string being passed to quote get escaped, for example?

Yes, the quote function is pretty much the equivalent of fmt.Sprintf("%q", str). See here

tariq1890 avatar May 28 '24 15:05 tariq1890

@elezar I think this would be a safer change as it results in no changes to the yaml parser. Strings like true and false unquoted are interpreted as booleans. In this helm chart, we are choosing to quote them explicitly.

tariq1890 avatar May 29 '24 14:05 tariq1890