Skip to content

Commit 652287d

Browse files
committed
Fix redfish_verify_ca boolean handling in certificate
The code was checking for the string 'False' (capital F), but when jq extracts a boolean false from JSON, it outputs 'false' (lowercase). This caused the check to fail, resulting in TLS verification being enabled even when redfish_verify_ca was set to false in nodes.json. Fixed by checking for both 'False' and 'false' in both: - utils.sh: node_map_to_install_config_hosts() function - ocp_install_env.sh: generate_ocp_host_manifest() function This ensures that disableCertificateVerification is correctly set to true when redfish_verify_ca is false, allowing Ironic to connect to iDRAC Redfish endpoints with self-signed certificates. Related to PR 1812 which enabled TLS validation for Redfish emulator.
1 parent c68ed3f commit 652287d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

ocp_install_env.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,8 @@ function generate_ocp_host_manifest() {
474474
encoded_password=$(echo -n "$password" | base64)
475475
if is_lower_version "$(openshift_version $OCP_DIR)" "4.22"; then
476476
# Heads up, "verify_ca" in ironic driver config, and "disableCertificateVerification" in BMH have opposite meaning
477-
disableCertificateVerification=$([ "$verify_ca" = "False" ] && echo "true" || echo "false")
477+
# Handle both boolean false and string "False" - jq outputs boolean false as lowercase "false"
478+
disableCertificateVerification=$([[ "${verify_ca,,}" = "false" ]] && echo "true" || echo "false")
478479
else
479480
disableCertificateVerification=false
480481
fi

utils.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ EOF
272272
if is_lower_version "$(openshift_version $OCP_DIR)" "4.22"; then
273273
# Heads up, "verify ca" in ironic driver config, and "disableCertificateVerification" in BMH have opposite meaning
274274
verify_ca=$(node_val ${idx} "driver_info.redfish_verify_ca")
275-
disable_certificate_verification=$([ "$verify_ca" = "False" ] && echo "true" || echo "false")
275+
# Handle both boolean false and string "False" - jq outputs boolean false as lowercase "false"
276+
disable_certificate_verification=$([[ "${verify_ca,,}" = "false" ]] && echo "true" || echo "false")
276277
cat << EOF
277278
disableCertificateVerification: ${disable_certificate_verification}
278279
EOF

0 commit comments

Comments
 (0)