Skip to content

Conversation

@taimurhafeez
Copy link

@taimurhafeez taimurhafeez commented Nov 25, 2025

To implement this PR:
One of the below is needed, or there will be an error creating Machine Config Pool e2e-invalid:

  1. The following line needs to be commented in tests/e2e/framework/main_entry.go
    line to be commented --> return fmt.Errorf("failed to create Machine Config Pool %s: %w", "e2e-invalid", err)

  2. Use CMP-3930: Include the required selectors to machineconfig to pass the ValidatingAdmissionPolicy #960

Run it using
make e2e-parallel E2E_GO_TEST_FLAGS="-v -run TestScanWithCustomStorageClass"

Expected result:

=== RUN   TestScanWithCustomStorageClass
=== PAUSE TestScanWithCustomStorageClass
=== CONT  TestScanWithCustomStorageClass
2025/12/03 15:44:32 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:44:37 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:44:42 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:44:47 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:44:52 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:44:57 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:45:02 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:45:07 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:45:12 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:45:17 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: RUNNING
2025/12/03 15:45:22 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: AGGREGATING
2025/12/03 15:45:27 waiting until suite test-scan-with-custom-storage-class-suite reaches target status 'DONE'. Current status: AGGREGATING
2025/12/03 15:45:38 ComplianceScan ready (DONE)
2025/12/03 15:45:38 All scans in ComplianceSuite have finished (test-scan-with-custom-storage-class-suite)
2025/12/03 15:45:38 Successfully verified PVC test-scan-with-custom-storage-class has storageClassName=test-scan-with-custom-storage-class-gold and accessModes=[ReadWriteOnce]
    main_test.go:5293: Successfully verified scan test-scan-with-custom-storage-class has custom storage configuration
--- PASS: TestScanWithCustomStorageClass (70.84s)
PASS

@openshift-ci-robot
Copy link
Collaborator

@taimurhafeez: This pull request references CMP-3805 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

Details

In response to this:

To implement this PR:
One of the below is needed, or there will be an error creating Machine Config Pool e2e-invalid:

  1. The following line needs to be commented in tests/e2e/framework/main_entry.go
    line to be commented --> return fmt.Errorf("failed to create Machine Config Pool %s: %w", "e2e-invalid", err)

  2. Use CMP-3930: Include the required selectors to machineconfig to pass the ValidatingAdmissionPolicy #960

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.

@openshift-ci
Copy link

openshift-ci bot commented Nov 25, 2025

Hi @taimurhafeez. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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 kubernetes-sigs/prow repository.

}
err = f.createInvalidMachineConfigPool("e2e-invalid")
if err != nil {
// log.Printf("continuing without invalid MachineConfigPool (cluster may have ValidatingAdmissionPolicy)")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this breaking because Printf expects a formatting directive that we're not supplying (e.g., %s).

Something like this might help:

name := "e2e-invalid"
err = f.createInvalidMachineConfigPool("e2e-invalid")
if err != nil {
    log.Printf("failed to create %s MachineConfigPool: %s", name, err)
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment has been removed.

}
}

// TestScanWithCustomStorageClass tests OCP-34928
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked this in the other review, but do we want to keep the downstream test IDs (OCP-34928)?

Copy link
Author

@taimurhafeez taimurhafeez Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has been removed.

return "", fmt.Errorf("failed to get provisioner from storage class: %w", err)
}
if !found {
return "", fmt.Errorf("provisioner field not found in default storage class")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what this ends up being for the default storage class in our CI clusters.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it more looks a rename here. Previously, we try to use some other storage class. But there isn't a single built-in StorageClass that works across all platforms. Only the third-party storage solutions work but additional actions needed to create it.

// Get the default storage class provisioner for our custom storage class
defaultProvisioner, err := f.GetDefaultStorageClassProvisioner()
if err != nil {
t.Fatalf("failed to get default storage class provisioner: %s", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this technically be considered a reason to skip this test?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhmdnd After discussing with Xiaojie, I have modified the test case.

Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - just one comment on if we want to consider skipping this test if the default storage class doesn't exist.

Otherwise this seems ready.

@openshift-ci
Copy link

openshift-ci bot commented Dec 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhmdnd, taimurhafeez

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Dec 8, 2025
@openshift-ci openshift-ci bot removed the lgtm label Dec 9, 2025
@openshift-ci
Copy link

openshift-ci bot commented Dec 9, 2025

@taimurhafeez: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-rosa f294849 link true /test e2e-rosa
ci/prow/e2e-aws-serial f294849 link true /test e2e-aws-serial

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@rhmdnd
Copy link
Collaborator

rhmdnd commented Dec 10, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants