File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -361,6 +361,8 @@ function generate_ocp_install_config() {
361361 NETWORK_TYPE=OVNKubernetes
362362 fi
363363
364+ OCP_VERSION=$( openshift_version $OCP_DIR )
365+
364366 cat > " ${outdir} /install-config.yaml" << EOF
365367apiVersion: v1
366368baseDomain: ${BASE_DOMAIN}
409411$( node_map_to_install_config_hosts $NUM_WORKERS $(( NUM_MASTERS + NUM_ARBITERS )) worker)
410412$( node_map_to_install_config_hosts $NUM_ARBITERS $NUM_MASTERS arbiter)
411413$( node_map_to_install_config_hosts $NUM_MASTERS 0 master)
414+ EOF
415+ fi
416+
417+ if ! is_lower_version " $( openshift_version $OCP_DIR ) " " 4.21" ; then
418+ cat >> " ${outdir} /install-config.yaml" << EOF
419+ bmcVerifyCA: |
420+ $( sudo sed ' s/^/ /' " ${WORKING_DIR} /virtualbmc/sushy-tools/cert.pem" )
412421EOF
413422 fi
414423
@@ -455,8 +464,12 @@ function generate_ocp_host_manifest() {
455464
456465 encoded_username=$( echo -n " $username " | base64)
457466 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" )
467+ if is_lower_version " $( openshift_version $OCP_DIR ) " " 4.21" ; then
468+ # Heads up, "verify_ca" in ironic driver config, and "disableCertificateVerification" in BMH have opposite meaning
469+ disableCertificateVerification=$( [ " $verify_ca " = " False" ] && echo " true" || echo " false" )
470+ else
471+ disableCertificateVerification=false
472+ fi
460473
461474 secret=" ---
462475apiVersion: v1
Original file line number Diff line number Diff line change @@ -260,13 +260,15 @@ function node_map_to_install_config_hosts() {
260260EOF
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 " $( openshift_version $OCP_DIR ) " " 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}
269270EOF
271+ fi
270272 fi
271273
272274
You can’t perform that action at this time.
0 commit comments