OCPBUGS-81666: Update storage driver to GCP for VAC E2E tests#16248
OCPBUGS-81666: Update storage driver to GCP for VAC E2E tests#16248cajieh wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@cajieh: This pull request references Jira Issue OCPBUGS-81666, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cajieh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test e2e-gcp-console |
1 similar comment
|
/test e2e-gcp-console |
2a35e6c to
2bdd0c8
Compare
📝 WalkthroughWalkthroughThis pull request migrates integration test fixtures and test suites from AWS/EBS-specific VolumeAttributesClass configurations to GCP-specific Hyperdisk configurations. The fixture file replaces the AWS CSI driver ( ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/packages/integration-tests/tests/storage/volume-attributes-class.cy.ts (1)
25-36: Potential race: Deployment created before PVC exists.The
before()hook creates the Deployment (line 35) before the first test creates the PVC it references. WhilevolumeBindingMode: WaitForFirstConsumerensures the PV isn't provisioned until a Pod schedules, the Deployment will initially have Pods inPendingstate with "persistentvolumeclaim not found" events.This should work since PVC creation is the first test action, but consider reordering to create the Deployment after PVC creation inside the test, or add a comment clarifying this intentional pattern for test parallelization.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/packages/integration-tests/tests/storage/volume-attributes-class.cy.ts` around lines 25 - 36, The before() hook currently applies the Deployment (constructed via getDeployment(testName, TEST_PVC)) before any PVC is created, causing initial Pod Pending events like "persistentvolumeclaim not found"; either move the Deployment creation out of before() and apply it after the test creates the PVC (i.e. create the PVC first in the test, then call the same oc apply for getDeployment(...)), or add an explicit inline comment in the before() block explaining the intentional ordering and why volumeBindingMode: WaitForFirstConsumer is relied upon to avoid flakes; locate the code around the before() hook and the getDeployment / TEST_PVC usage to implement the chosen fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@frontend/packages/integration-tests/tests/storage/volume-attributes-class.cy.ts`:
- Around line 25-36: The before() hook currently applies the Deployment
(constructed via getDeployment(testName, TEST_PVC)) before any PVC is created,
causing initial Pod Pending events like "persistentvolumeclaim not found";
either move the Deployment creation out of before() and apply it after the test
creates the PVC (i.e. create the PVC first in the test, then call the same oc
apply for getDeployment(...)), or add an explicit inline comment in the before()
block explaining the intentional ordering and why volumeBindingMode:
WaitForFirstConsumer is relied upon to avoid flakes; locate the code around the
before() hook and the getDeployment / TEST_PVC usage to implement the chosen
fix.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: b42e9d8e-b1d5-449a-b7cf-3187e8642b35
📒 Files selected for processing (3)
frontend/packages/integration-tests/mocks/volume-attributes-class.tsfrontend/packages/integration-tests/tests/crud/resource-crud.cy.tsfrontend/packages/integration-tests/tests/storage/volume-attributes-class.cy.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
frontend/packages/integration-tests/tests/crud/resource-crud.cy.tsfrontend/packages/integration-tests/tests/storage/volume-attributes-class.cy.tsfrontend/packages/integration-tests/mocks/volume-attributes-class.ts
🔀 Multi-repo context openshift/console-operator
Findings for openshift/console-operator
-
VolumeAttributesClass types and API presence: multiple generated API files include VolumeAttributesClass definitions and fields (storage.k8s.io v1/v1alpha1/v1beta1). Example files:
- vendor/k8s.io/api/storage/v1/types.go (VolumeAttributesClass type) [::openshift/console-operator::vendor/k8s.io/api/storage/v1/types.go]
- vendor/k8s.io/api/storage/v1alpha1/types.go (VolumeAttributesClass prerelease) [::openshift/console-operator::vendor/k8s.io/api/storage/v1alpha1/types.go]
- vendor/k8s.io/api/storage/v1beta1/types.go (VolumeAttributesClass prerelease) [::openshift/console-operator::vendor/k8s.io/api/storage/v1beta1/types.go]
-
Core PVC fields referencing VAC: core API contains volumeAttributesClassName, current/targetVolumeAttributesClassName and modifyVolumeStatus docs/fields:
- vendor/k8s.io/api/core/v1/types.go (VolumeAttributesClassName, Current/TargetVolumeAttributesClassName) [::openshift/console-operator::vendor/k8s.io/api/core/v1/types.go]
- vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go (docs for volumeAttributesClassName/modifyVolumeStatus) [::openshift/console-operator::vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go]
-
CSI driver constants / CRD manifests include both AWS EBS and GCP PD drivers:
- vendor/github.com/openshift/api/operator/v1/types_csi_cluster_driver.go defines AWSEBSCSIDriver = "ebs.csi.aws.com" and GCPPDCSIDriver = "pd.csi.storage.gke.io" [::openshift/console-operator::vendor/github.com/openshift/api/operator/v1/types_csi_cluster_driver.go]
- Generated CRD manifests list both drivers (e.g., vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/... contains ebs.csi.aws.com and pd.csi.storage.gke.io) [::openshift/console-operator::vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-Default.crd.yaml]
Implication: the repo’s vendored APIs and manifests already recognize VolumeAttributesClass and include both ebs.csi.aws.com and pd.csi.storage.gke.io drivers, so the PR’s switch from AWS→GCP for VAC E2E test fixtures aligns with drivers present in the codebase; no obvious API-name mismatches found in this repo based on the grep results. [::openshift/console-operator::]
🔇 Additional comments (8)
frontend/packages/integration-tests/tests/crud/resource-crud.cy.ts (1)
83-92: Clean separation of VAC from AWS-gated resources.Good architectural decision to extract
vacObjsas a standalone map merged unconditionally. This correctly reflects that VolumeAttributesClass now runs on GCP with Hyperdisk, while snapshot tests remain AWS-specific. Thenamespaced: falsesetting is accurate for cluster-scoped VAC resources.frontend/packages/integration-tests/tests/storage/volume-attributes-class.cy.ts (3)
62-77: Well-structured cleanup with finalizer handling.The defensive finalizer patching before VAC deletion is a solid pattern for cluster-scoped resources that may have deletion finalizers. Using
--wait=falsewithfailOnNonZeroExit: falseprevents test suite hangs during cleanup. Good K8s resource management.
119-149: Proper synchronization for VAC modification flow.Good sequencing: checking
Boundstatus andpvc-current-vacexistence (lines 124-125) before attempting modification prevents flaky failures from racing the CSI driver. The 120s timeout forcurrentVolumeAttributesClassNameupdates is appropriate for cloud CSI operations.
151-181: Comprehensive negative test for CSI driver validation.Solid coverage of the error path: verifying both the alert visibility (lines 173-177) and that
currentVolumeAttributesClassNameremains at the last valid value (line 180). This confirms the UI correctly reflects CSI driver rejection without corrupting state.frontend/packages/integration-tests/mocks/volume-attributes-class.ts (4)
30-42: Smart optimization for test reliability.Using identical parameters for
VAC_STANDARDandVAC_PERFORMANCEis a pragmatic approach—it validates the UI/API flow for VAC modification without waiting for actual CSI volume operations. The comment clearly documents this intentional design decision.
43-53: Appropriate out-of-bounds values for error testing.The
999999IOPS and throughput values reliably exceed GCP Hyperdisk limits, ensuring consistent CSI driver rejection for the negative test case. Good test fixture design.
54-65: Correct StorageClass configuration for GCP Hyperdisk.
volumeBindingMode: WaitForFirstConsumeris the right choice for zonal PDs—ensures provisioning happens in the Pod's zone. Combined withallowVolumeExpansion: trueandhyperdisk-balancedtype, this is a solid foundation for VAC E2E testing.
24-28: No changes needed — thethroughput: '140Mi'format is correct.GCP PD CSI driver documentation explicitly uses the
Misuffix format for throughput parameters (e.g.,"188Mi","345Mi"in MiB/s). The mock fixtures in this file align with the official GCP specification.
|
@cajieh: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
| import { modal } from '../../views/modal'; | ||
|
|
||
| // These tests require AWS platform with EBS CSI driver for modifyVolume support | ||
| const isAws = String(Cypress.expose('BRIDGE_AWS')).toLowerCase() === 'true'; |
There was a problem hiding this comment.
I think we will need to keep this guardrail, since for the console operator we are running also console e2e on AWS
Summary by CodeRabbit