Skip to content

Commit b3f91ce

Browse files
committed
Enable TLS validation for Redfish emulator
Starting with 4.21, we can pass the CA certificate to the installer. Signed-off-by: Dmitry Tantsur <[email protected]>
1 parent 41cd770 commit b3f91ce

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

ocp_install_env.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,13 @@ EOF
409409
$(node_map_to_install_config_hosts $NUM_WORKERS $(( NUM_MASTERS + NUM_ARBITERS )) worker)
410410
$(node_map_to_install_config_hosts $NUM_ARBITERS $NUM_MASTERS arbiter)
411411
$(node_map_to_install_config_hosts $NUM_MASTERS 0 master)
412+
EOF
413+
fi
414+
415+
if ! is_lower_version "${OCP_VERSION}" "4.21"; then
416+
cat >> "${outdir}/install-config.yaml" << EOF
417+
bmcVerifyCA: |
418+
$(sudo sed 's/^/ /' "${WORKING_DIR}/virtualbmc/sushy-tools/cert.pem")
412419
EOF
413420
fi
414421

@@ -455,8 +462,12 @@ function generate_ocp_host_manifest() {
455462

456463
encoded_username=$(echo -n "$username" | base64)
457464
encoded_password=$(echo -n "$password" | base64)
458-
# Heads up, "verify_ca" in ironic driver config, and "disableCertificateVerification" in BMH have opposite meaning
459-
disableCertificateVerification=$([ "$verify_ca" = "False" ] && echo "true" || echo "false")
465+
if is_lower_version "${OCP_VERSION}" "4.21"; then
466+
# Heads up, "verify_ca" in ironic driver config, and "disableCertificateVerification" in BMH have opposite meaning
467+
disableCertificateVerification=$([ "$verify_ca" = "False" ] && echo "true" || echo "false")
468+
else
469+
disableCertificateVerification=false
470+
fi
460471

461472
secret="---
462473
apiVersion: v1

utils.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,15 @@ function node_map_to_install_config_hosts() {
260260
EOF
261261

262262
if [[ "$driver_prefix" == "redfish" ]]; then
263-
# Set disableCertificateVerification
264-
# Heads up, "verify ca" in ironic driver config, and "disableCertificateVerification" in BMH have opposite meaning
265-
verify_ca=$(node_val ${idx} "driver_info.redfish_verify_ca")
266-
disable_certificate_verification=$([ "$verify_ca" = "False" ] && echo "true" || echo "false")
267-
cat << EOF
263+
# Set disableCertificateVerification on older versions
264+
if is_lower_version "${OCP_VERSION}" "4.21"; then
265+
# Heads up, "verify ca" in ironic driver config, and "disableCertificateVerification" in BMH have opposite meaning
266+
verify_ca=$(node_val ${idx} "driver_info.redfish_verify_ca")
267+
disable_certificate_verification=$([ "$verify_ca" = "False" ] && echo "true" || echo "false")
268+
cat << EOF
268269
disableCertificateVerification: ${disable_certificate_verification}
269270
EOF
271+
fi
270272
fi
271273

272274

0 commit comments

Comments
 (0)