-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function toBool to convert string "true" or "false" to real boolean type #10382
Comments
I think the simplest method would be to e.g. (spitballing, may not actually compile)
Then you can use it like so:
In any case you could propose this as a new helper function to sprig, which is the library used by helm to provide helper functions like this one. But everyone may have opinions on what they'd consider to be truthy or non-truthy values which is why I think a local Another alternative is to just return a non-empty or empty value as the output of |
quick solution: change your last line in isSSLEnabled to
|
Thank you for all this information, you confirm this doesn't exist (yet) and we should rely on "missing value" instead of real boolean, which makes me sad 😅 and harder to debug 🤷♂️ I'm not the only one with this need I think: Masterminds/sprig#258 Thank you again, I'll try as soon as possible your solution(s). |
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
Hello everyone,
I'm currently trying to use
_helpers.tpl
to host logic about a common behaviour:This returns, obviously, a
string
, so I have to write something like this:I would prefer, and think, something like this could be more simpler to read:
BTW, if you think a better, simpler, more idiomatic solution is possible, feel free to share it with me. I've seen a lot of circumvention (especially by returning anything instead of false in template) but it was still more complex to read / maintain from my point of view.
NOTE: This code example is WAY more simpler than my usecase, I have a lot of condition and usages in our template.
Thank for your help and support
The text was updated successfully, but these errors were encountered: