[IUO] Restart ocs-operator after CNV reinstall to create virt StorageClass #6304
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 451 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.366
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #6304"
general
weight: 0.35
geetikakay
##### What this PR does / why we need it:
test_default_storage_class_setfails intermittently (~60%) intest-cnv-4.22-iuo-install-productionbecauseocs-storagecluster-ceph-rbd-virtualizationStorageClass is never created after CNV uninstall/reinstall.Root cause: OCS only creates the virt StorageClass when the
VirtualMachineCRD is present (ocs-operator PR #2076). After CNV reinstall,ocs-operatordoes not automatically reconcile to create the SC (BZ2322458). The existing workaround indeploy_cnv.shrestartsocs-operatorexplicitly, but this only runs during initial deploy — not during the iuo-install test job's reinstall flow.Why it passes sometimes: If
ocs-storagecluster-ceph-rbd-virtualizationexists as a leftover from a previous run where the restart was triggered, the fixture finds it immediately (false positive). A companion fix incnv-qe-automationdeletes the SC on CNV undeploy to prevent this.Fix: Add
restart_ocs_operator_for_virt_sc()totests/install_upgrade_operators/product_install/utils.py. The helper waits for theocs-operatorpod to be available, deletes it withdelete(wait=True)so the Deployment controller recreates it, then waits for replicas to recover. Indefault_storage_class_from_config, call this helper before the polling loop when the target SC isocs-storagecluster-ceph-rbd-virtualizationand it does not yet exist — triggering OCS reconciliation within the test instead of relying on external scripts.Changes:
tests/install_upgrade_operators/product_install/utils.py: newrestart_ocs_operator_for_virt_sc(admin_client)— usesensure_exists=Trueon theocs-operatorDeployment (raisesNotFoundif absent), raisesResourceMismatchif replica count is zero, waits for the pod viaTimeoutSampler, deletes it withdelete(wait=True), then callswait_for_replicas(timeout=TIMEOUT_10MIN). Pod deletion is used instead ofclean_up()to avoidSKIP_RESOURCE_TEARDOWNinterference.tests/install_upgrade_operators/product_install/conftest.py:default_storage_class_from_configcalls the helper conditionally before the 5-minute StorageClass poll.utilities/unittests/test_storage.py: removes unit tests for the function that was previously inutilities/storage.py(now moved toproduct_install/utils.py).##### Which issue(s) this PR fixes:
CNV-97297
##### Special notes for reviewer:
delete(wait=True)is intentional overclean_up():clean_up()respectsSKIP_RESOURCE_TEARDOWN, which would silently skip the pod deletion during debug sessions and cause the test to hang.product_install/utils.py(notutilities/storage.py) because it is only needed by the product install flow and has no reuse outside that context.cnv-qe-automationcommit0ecbfd7c1deletesocs-storagecluster-ceph-rbd-virtualizationonundeploy_cnv.shto eliminate false-positive passes from leftover SCs.##### jira-ticket:
CNV-97297
🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Tests
Installation and upgrade checks now handle a missing Ceph RBD virtualization storage class by restarting the storage operator and waiting for it to become available. Checks using other storage classes are unchanged. This improves the reliability of validation when the virtualization storage class is not present at the start of a check.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->