Skip to content

Commit ae81aba

Browse files
committed
OCPEDGE-1749: [TNF] Reworked TNF logic to render fencing block conditionally.
Two Node OpenShift with Fencing (TNF) is a deployment topology with two control-plane nodes that was introduce as a Dev Preview in OpenShift 4.19. This commit updates the logic around TNF to only render fencing credentials in releases 4.19 and up, and also the sslInsecure parameter so that it uses certificateVerification in 4.20 and up, as introduced in openshift/installer#9640.
1 parent 4035a38 commit ae81aba

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

utils.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ function node_map_to_install_config_hosts() {
258258
boot_mode="UEFI"
259259
fi
260260

261+
261262
cat << EOF
262263
- name: ${name}
263264
role: ${node_role}
@@ -304,6 +305,13 @@ EOF
304305
}
305306

306307
function node_map_to_install_config_fencing_credentials() {
308+
TNF_ENABLED_RELEASE=4.19
309+
310+
# If we didn't support TNF in this release, we skip rendering the fencing block
311+
if is_lower_version "$(openshift_version "${OCP_DIR}")" "$TNF_ENABLED_RELEASE"; then
312+
return 0
313+
fi
314+
307315
if [[ -z "${ENABLE_ARBITER:-}" ]] && [[ "${NUM_MASTERS}" -eq 2 ]]; then
308316
cat <<EOF
309317
fencing:
@@ -320,7 +328,14 @@ EOF
320328
address: ${address}
321329
username: ${username}
322330
password: ${password}
323-
sslInsecure: true
331+
EOF
332+
# We don't support overriding certificateVerification in 4.19
333+
if [ $(openshift_version "${OCP_DIR}") == "$TNF_ENABLED_RELEASE" ]; then
334+
continue
335+
fi
336+
337+
cat <<EOF
338+
certificateVerification: $([ node_val ${idx} "driver_info.disableCertificateVerification" | tr '[:upper:]' '[:lower:]' == "true" ] && echo -n "Disabled" || echo -n "Enabled")
324339
EOF
325340
done
326341
fi

0 commit comments

Comments
 (0)