You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can't set boolean-looking environment variables for containers using the extraEnvs config provided by the django-ida Helm chart.
Setting a value to true or false results in a sync failure with an error message like unrecognized type: string following a large blob of config. Inspecting the config, we can see it includes something like {\"name\":\"DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT\",\"value\":true}—the boolean true rather than the string "true". This happens even if the boolean was originally quoted as a string. Likely we're falling prey to Jinja-templated-YAML failing to escape the values it writes, inadvertently converting strings to bools.
Setting a (quoted) boolean directly in the env subtree of the django-ida Helm chart works fine, so likely what we need to do is stringify and quote the env var values in the loop where we apply extraEnvs.
A/C:
Boolean environment variables can be set in extraEnvs
Sort of fixed, but need to switch from quote to (probably) string -- quote is for shell scripts
Optional: Validation in place to prevent committing the wrong type, if the fix still allows for that
Optional: Error message is improved
Currently it says unrecognized type: string but this seems to be backwards; the message should be unrecognized type: bool
The text was updated successfully, but these errors were encountered:
It was fixed in https://github.com/edx/helm-charts/pull/150/files but I may want to re-fix it—the function they used was quote, which is appropriate for use in shell scripts rather than for YAML files. I think we want string instead. It's relatively low priority but should be a quick fix (now that I have documented how to test helm-charts changes locally!)
We can't set boolean-looking environment variables for containers using the
extraEnvs
config provided by the django-ida Helm chart.Setting a value to
true
orfalse
results in a sync failure with an error message likeunrecognized type: string
following a large blob of config. Inspecting the config, we can see it includes something like{\"name\":\"DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT\",\"value\":true}
—the booleantrue
rather than the string"true"
. This happens even if the boolean was originally quoted as a string. Likely we're falling prey to Jinja-templated-YAML failing to escape the values it writes, inadvertently converting strings to bools.Setting a (quoted) boolean directly in the
env
subtree of the django-ida Helm chart works fine, so likely what we need to do is stringify and quote the env var values in the loop where we apply extraEnvs.A/C:
quote
to (probably)string
--quote
is for shell scriptsunrecognized type: string
but this seems to be backwards; the message should beunrecognized type: bool
The text was updated successfully, but these errors were encountered: