diff --git a/ci-operator/config/openshift/release/openshift-release-master__nightly-4.21.yaml b/ci-operator/config/openshift/release/openshift-release-master__nightly-4.21.yaml index e2b6574107bba..a706d084944f0 100644 --- a/ci-operator/config/openshift/release/openshift-release-master__nightly-4.21.yaml +++ b/ci-operator/config/openshift/release/openshift-release-master__nightly-4.21.yaml @@ -976,6 +976,7 @@ tests: CSI_MANAGEMENT_REMOVED: "true" FEATURE_GATES: '["VSphereMixedNodeEnv=true"]' FEATURE_SET: CustomNoUpgrade + STORAGE_CO_DEGRADE_CHECK: "true" TEST_SKIPS: \[sig-storage\]\|\[sig-arch\]\[Early\] Operators low level operators workflow: openshift-e2e-vsphere-upi-hybrid-env - as: e2e-vsphere-ovn-disk-setup-techpreview diff --git a/ci-operator/config/openshift/release/openshift-release-master__nightly-4.22.yaml b/ci-operator/config/openshift/release/openshift-release-master__nightly-4.22.yaml index 34c673f1e11da..75325eff9b8d4 100644 --- a/ci-operator/config/openshift/release/openshift-release-master__nightly-4.22.yaml +++ b/ci-operator/config/openshift/release/openshift-release-master__nightly-4.22.yaml @@ -973,6 +973,7 @@ tests: CSI_MANAGEMENT_REMOVED: "true" FEATURE_GATES: '["VSphereMixedNodeEnv=true"]' FEATURE_SET: CustomNoUpgrade + STORAGE_CO_DEGRADE_CHECK: "true" TEST_SKIPS: \[sig-storage\]\|\[sig-arch\]\[Early\] Operators low level operators workflow: openshift-e2e-vsphere-upi-hybrid-env - as: e2e-vsphere-ovn-disk-setup-techpreview diff --git a/ci-operator/step-registry/ipi/install/vsphere/virt/ipi-install-vsphere-virt-commands.sh b/ci-operator/step-registry/ipi/install/vsphere/virt/ipi-install-vsphere-virt-commands.sh index 28e96b358e096..d30917aa5d1a8 100755 --- a/ci-operator/step-registry/ipi/install/vsphere/virt/ipi-install-vsphere-virt-commands.sh +++ b/ci-operator/step-registry/ipi/install/vsphere/virt/ipi-install-vsphere-virt-commands.sh @@ -96,6 +96,20 @@ function wait_for_co_ready() { fi } +# Wait for Storage cluster operator to have degraded status +function wait_for_storage_co_degrade() { + echo "$(date -u --rfc-3339=seconds) - Waiting for Storage cluster operator to degrade" + if ! oc wait --for=jsonpath='{.status.conditions[?(@.type=="Degraded")].status}'=True clusteroperator/storage --timeout=60m; then + echo "$(date -u --rfc-3339=seconds) - FAILED: Storage cluster operator did not degrade" + exit 1 + fi +} + +# Patch CSI driver management state to be Removed +function patch_csi_driver_removed() { + echo "$(date -u --rfc-3339=seconds) - Patching clustercsidriver managementState to be Removed" + oc patch clustercsidriver csi.vsphere.vmware.com --type=merge --patch 'spec: {managementState: "Removed"}' +} # We are going to apply the 'node.openshift.io/platform-type=vsphere' label to all existing nodes as a workaround while waiting for upstream CCM changes # When upstream changes are merged downstream, the function will output that no nodes were updated. @@ -141,9 +155,9 @@ done # Update CSI driver to be removed. Note, sometimes this can take a little while to start removing pods, but only on first attempt. # For now, we'll update and move on. It should be resolved by the time the BM is ready to join. -if [ "${CSI_MANAGEMENT_REMOVED}" == "true" ]; then - echo "$(date -u --rfc-3339=seconds) - Patching clustercsidriver managementState to be Removed" - oc patch clustercsidriver csi.vsphere.vmware.com --type=merge --patch 'spec: {managementState: "Removed"}' +# If STORAGE_CO_DEGRADE_CHECK is true, we will patch clustercsidriver managementState later to make sure the Storage cluster operator degrades. +if [ "${CSI_MANAGEMENT_REMOVED}" == "true" ] && [ "${STORAGE_CO_DEGRADE_CHECK}" == "false" ]; then + patch_csi_driver_removed fi # Start VM @@ -163,5 +177,17 @@ done # Wait for node to be ready to prevent any interruption during the e2e tests wait_for_node_ready +# Verifying Storage cluster operator is degraded for (OCP >=4.21) feature, STOR-2620: vSphere Bare Metal nodes support +# Wait for Storage cluster operator to degrade +if [ "${STORAGE_CO_DEGRADE_CHECK}" == "true" ]; then + wait_for_storage_co_degrade +fi + +# Update CSI driver to be removed. Note, sometimes this can take a little while to start removing pods, but only on first attempt. +# We will patch clustercsidriver managementState now if skipped earlier. +if [ "${CSI_MANAGEMENT_REMOVED}" == "true" ] && [ "${STORAGE_CO_DEGRADE_CHECK}" == "true" ]; then + patch_csi_driver_removed +fi + # Wait for all CO to be stable wait_for_co_ready diff --git a/ci-operator/step-registry/ipi/install/vsphere/virt/ipi-install-vsphere-virt-ref.yaml b/ci-operator/step-registry/ipi/install/vsphere/virt/ipi-install-vsphere-virt-ref.yaml index b73cbe105f26c..4f51165606c61 100644 --- a/ci-operator/step-registry/ipi/install/vsphere/virt/ipi-install-vsphere-virt-ref.yaml +++ b/ci-operator/step-registry/ipi/install/vsphere/virt/ipi-install-vsphere-virt-ref.yaml @@ -23,6 +23,10 @@ ref: default: "false" documentation: |- Specifies if cluster should modify the csi driver operator's management state to be "Removed". + - name: STORAGE_CO_DEGRADE_CHECK + default: "false" + documentation: |- + Specifies if storage cluster operator degrade check should be performed. documentation: >- static IP addresses are allocated and stored in $SHARED_DIR/hosts.txt for later use in creating an install-config.yaml with static IP address