-
Notifications
You must be signed in to change notification settings - Fork 1
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
Lowercase bool variables values for consistency #16
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding all the places! 👍
The change looks good overall,
Looks like this plugin does something special with the converters
, so try to find out the logic there how the conversion applies and at which step. As discussed, please test the helm plugin manually if lowercasing would work OK and doesn't break the normal plugin execution.
@LeoDiazL Please provide your findings in the comments so this PR could be merged.
if [[ "${FETCH_KUBECONFIG}" == "False" ]]; then | ||
if [[ "${FETCH_KUBECONFIG}" == "false" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the conversation, this one is still coming uppercased.
The ENV var default is defined in the
Lines 69 to 71 in ecac7a1
type: boolean | |
default: true | |
export_env: FETCH_KUBECONFIG |
The context is that Helm chart is using
Line 11 in ecac7a1
core_schema_parsing: false |
meaning bool var parsing is happening inside the Helm chart with some
bash
.
We'll need to ideally find the place where it's happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like in the helm
pack shyaml
tool is used for parsing the plugin schema
k="$(cat $SCHEMA_FILE | shyaml keys $rootkey)" |
which probably converts bool values to the uppercase.
Worth the debugging here:
helm/scripts/bitops-config/converters/boolean.sh
Lines 19 to 20 in 097ad8a
elif [ "$value" == "True" ]; then | |
OUTPUT="${cli_flag}" |
helm/scripts/bitops-config/convert-schema.sh
Line 129 in ecac7a1
default="$($SCRIPTS_DIR/bitops-config/get.sh $SCHEMA_FILE "${full_value_path_schema}.default")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative approach is to throw away all this bash
insanity https://github.com/bitops-plugins/helm/blob/main/scripts/bitops-config/convert-schema.sh and switch to (now fixed) core_schema_parsing: true
Line 11 in ecac7a1
core_schema_parsing: false |
Converted to lower-case and added validations to avoid issues.