Skip to content

NE-2292: Tests for gatewayAPIWithoutOLM featuregate graduation#30905

Open
rhamini3 wants to merge 3 commits intoopenshift:mainfrom
rhamini3:noolm-tests
Open

NE-2292: Tests for gatewayAPIWithoutOLM featuregate graduation#30905
rhamini3 wants to merge 3 commits intoopenshift:mainfrom
rhamini3:noolm-tests

Conversation

@rhamini3
Copy link
Contributor

@rhamini3 rhamini3 commented Mar 18, 2026

This includes 5 unique tests which are to be used to graduate
the featuregate from techpreview to GA. There are some tests
which fall common within gatewayAPIController and
GatewayAPIWithoutOLM.

@openshift-ci-robot
Copy link

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 18, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 18, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 18, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 18, 2026

@rhamini3: This pull request references Ne-2292 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.22.0" version, but no target version was set.

Details

In response to this:

This contains 5 unique tests to be run to help graduate the GatewayAPIWithoutOLM featureGate to GA

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.

@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74b91c37-c433-4522-baf9-252f0cc9f940

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds GatewayAPIWithoutOLM branches to Gateway API controller tests: new constants, conditional capability gating, gated test cases validating GatewayClass conditions/finalizer, resource presence/absence, istiod checks, updated cleanup flows, helper functions, and switches GIE verification to read an istiod env var; also exposes a new CLI method for the apiextensions v1 client.

Changes

Cohort / File(s) Summary
Gateway API controller tests
test/extended/router/gatewayapicontroller.go
Adds GatewayAPIWithoutOLM-scoped constants and marker keys; changes setup to apply SkipIfMissingCapabilities only when the flag is disabled; replaces checkGatewayClass with checkGatewayClassCondition; adds gated It blocks validating GatewayClass conditions/finalizer, absence of Sail operator/Subscription/CSV/CRs, presence of istiod Deployment and CIO ownership labels on istio CRDs; adjusts custom GatewayClass deletion checks and AfterEach cleanup to branch on the feature flag (only wait for istiod pod deletion when no OLM; otherwise delete istio CR then cleanup OSSM resources via Sail status.refs); introduces helpers checkIstiodExists, ensureSailOperatorResourceDoesNotExist, checkGatewayClassCondition, checkGatewayClassFinalizer, assertIstioCRDsOwnedByCIO, and assertSailOperatorCRDsAreNotPresent.
Client API extension
test/extended/util/client.go
Adds import for apiextensions/v1 and a new public method func (c *CLI) ApiextensionsV1() apiextensionsv1.ApiextensionsV1Interface using NewForConfigOrDie(c.AdminConfig()).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@rhamini3 rhamini3 changed the title Ne-2292: Tests for gatewayAPIWithoutOLM featuregate graduation NE-2292: Tests for gatewayAPIWithoutOLM featuregate graduation Mar 18, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 18, 2026

@rhamini3: This pull request references NE-2292 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.22.0" version, but no target version was set.

Details

In response to this:

This contains 5 unique tests to be run to help graduate the GatewayAPIWithoutOLM featureGate to GA

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.

@rhamini3
Copy link
Contributor Author

/testwith openshift/origin/main/e2e-gcp-ovn-techpreview openshift/cluster-ingress-operator#1354

@rhamini3
Copy link
Contributor Author

CC @gcs278

@gcs278
Copy link
Contributor

gcs278 commented Mar 19, 2026

If you are ready for comments, code rabbit might be worth looking at:
@coderabbitai

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

@gcs278 Sure! I'll start reviewing the pull request now.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/router/gatewayapicontroller.go`:
- Around line 1340-1355: In istioManagedCRDs, ensure you fail when no *.istio.io
CRDs are found and fix the label lookup logic: iterate crdList.Items and count
matches for strings.Contains(crd.Name, "istio.io"); after the loop, if count ==
0 return an error (e.g., fmt.Errorf("no istio CRDs found")); inside the loop use
the correct map lookup syntax value, ok :=
crd.Labels["ingress.operator.openshift.io/owned"] (not err) and check ok &&
value == "true" before logging, otherwise call e2e.Failf for that CRD.
- Around line 55-59: The test completion keys gatewayClassConditions,
gatewayClassFinalizer, noOLMResourcesPresent, istioCRDsManagedbyCIO, and
noSailoperatorCRDs need to be added to the shared testNames collection so
markTestDone can signal completion for the new GatewayAPIWithoutOLM specs;
update the testNames variable (the list used by checkAllTestsDone()) to include
these five new constants and ensure markTestDone and checkAllTestsDone reference
that same collection so the AfterEach cleanup path for GatewayClass/Istio runs
when those tests are selected.
- Around line 239-246: The current checks use generic type-only queries which
can succeed if any same-type resource exists elsewhere; update the calls so they
explicitly query the expected namespace and assert zero results or absence of
the specific operator objects: change calls to checkIfResourceExists to target
the namespace (expectedSubscriptionNamespace) and verify there are no
subscriptions, CSVs or pods in that namespace (e.g., use a namespaced get/list
and assert count==0), and replace the Istio check that runs
oc.AsAdmin().Run("get").Args("istio") with a check for the Istio operator CRD/CR
kind (e.g., get the istio.operator.openshift.io CRD or list
istio.operator.openshift.io resources) and assert the CRD is absent or that no
Istio CR instances exist (zero items) so the test cannot be fooled by a present
CRD with zero resources.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f88f54c5-b18f-43be-a734-c2e4f9d28f28

📥 Commits

Reviewing files that changed from the base of the PR and between a45902d and 41dc342.

📒 Files selected for processing (2)
  • test/extended/router/gatewayapicontroller.go
  • test/extended/util/client.go

Copy link
Contributor

@gcs278 gcs278 left a comment

Choose a reason for hiding this comment

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

Overall looking good!

@rhamini3 rhamini3 marked this pull request as ready for review March 19, 2026 04:50
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 19, 2026
@openshift-ci openshift-ci bot requested review from miheer and sjenning March 19, 2026 04:50
@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@rhamini3
Copy link
Contributor Author

/testwith openshift/origin/main/e2e-gcp-ovn-techpreview openshift/cluster-ingress-operator#1354

@rhamini3
Copy link
Contributor Author

/retest

@rhamini3
Copy link
Contributor Author

/testwith openshift/origin/main/e2e-gcp-ovn-techpreview openshift/cluster-ingress-operator#1354

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@rhamini3
Copy link
Contributor Author

/testwith openshift/origin/main/e2e-gcp-ovn-techpreview openshift/cluster-ingress-operator#1354

@gcs278
Copy link
Contributor

gcs278 commented Mar 19, 2026

I'm not sure if your changes from last night passed, but now that openshift/cluster-ingress-operator#1354 is merged, we don't have to use testwith:

/test e2e-gcp-ovn-techpreview

@rhamini3
Copy link
Contributor Author

/test e2e-gcp-ovn-techpreview

@rhamini3
Copy link
Contributor Author

I'm not sure if your changes from last night passed, but now that openshift/cluster-ingress-operator#1354 is merged, we don't have to use testwith:

/test e2e-gcp-ovn-techpreview

is the change instant, or do we need to wait for a nightly image to contain the PR changes?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/extended/router/gatewayapicontroller.go (1)

1290-1293: Consider handling additional error message variants for robustness.

Per the earlier review discussion, oc can produce "no matches for" on some versions when resource types are unregistered. Adding this variant would improve robustness across different cluster configurations.

Suggested improvement
 	// If the CRD doesn't exist (OLM not installed), that's fine - no resources exist
-	if err != nil && strings.Contains(err.Error(), "the server doesn't have a resource type") {
+	if err != nil && (strings.Contains(err.Error(), "the server doesn't have a resource type") ||
+		strings.Contains(err.Error(), "no matches for")) {
 		return
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/router/gatewayapicontroller.go` around lines 1290 - 1293, The
current error check only looks for "the server doesn't have a resource type"
which misses other oc/kubectl variants; update the conditional that uses err and
strings.Contains(err.Error(), ...) to also check for "no matches for" (e.g.
using || to check strings.Contains(err.Error(), "no matches for") or normalize
the message and search for both substrings) so the block in
gatewayapicontroller.go that returns on unregistered CRDs handles both "the
server doesn't have a resource type" and "no matches for" error messages.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/router/gatewayapicontroller.go`:
- Line 66: The constant noOLMResourcesPresent has a typo in its string value
("no-olm-reources"); update the value to "no-olm-resources" so the annotation
key is spelled correctly, ensuring anywhere that uses noOLMResourcesPresent
(e.g., test completion tracking) gets the corrected annotation string.

---

Nitpick comments:
In `@test/extended/router/gatewayapicontroller.go`:
- Around line 1290-1293: The current error check only looks for "the server
doesn't have a resource type" which misses other oc/kubectl variants; update the
conditional that uses err and strings.Contains(err.Error(), ...) to also check
for "no matches for" (e.g. using || to check strings.Contains(err.Error(), "no
matches for") or normalize the message and search for both substrings) so the
block in gatewayapicontroller.go that returns on unregistered CRDs handles both
"the server doesn't have a resource type" and "no matches for" error messages.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 246ef984-3774-47c7-a07e-255375a18bc7

📥 Commits

Reviewing files that changed from the base of the PR and between 31e59d2 and c7d06db.

📒 Files selected for processing (1)
  • test/extended/router/gatewayapicontroller.go

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

This includes 5 unique tests which are to be used to graduate
the featuregate from techpreview to GA. There are some tests
which fall common within gatewayAPIController and
GatewayAPIWithoutOLM.

JIRA: https://redhat.atlassian.net/browse/NE-2292
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 19, 2026

@rhamini3: This pull request references NE-2292 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.22.0" version, but no target version was set.

Details

In response to this:

This includes 5 unique tests which are to be used to graduate
the featuregate from techpreview to GA. There are some tests
which fall common within gatewayAPIController and
GatewayAPIWithoutOLM.

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.

@rhamini3
Copy link
Contributor Author

/test e2e-gcp-ovn-techpreview

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@rhamini3
Copy link
Contributor Author

/test e2e-gcp-ovn-techpreview

@gcs278
Copy link
Contributor

gcs278 commented Mar 19, 2026

Excellent work @rhamini3! we need to get this in ASAP so we can have 7 days of CI signal before pencils down.

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2026
@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

}

func assertIstioCRDsOwnedByCIO(oc *exutil.CLI) error {
crdList, err := oc.ApiextensionsV1().CustomResourceDefinitions().List(context.Background(), metav1.ListOptions{})
Copy link
Contributor

@gcs278 gcs278 Mar 19, 2026

Choose a reason for hiding this comment

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

You should use this and you can remove your changes to test/extended/util/client.go:

Suggested change
crdList, err := oc.ApiextensionsV1().CustomResourceDefinitions().List(context.Background(), metav1.ListOptions{})
crdList, err := oc.AdminApiextensionsClient().ApiextensionsV1().CustomResourceDefinitions().List(context.Background(), metav1.ListOptions{})

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 19, 2026

New changes are detected. LGTM label has been removed.

@rhamini3
Copy link
Contributor Author

/test e2e-gcp-ovn-techpreview

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 19, 2026
@gcs278
Copy link
Contributor

gcs278 commented Mar 19, 2026

Okay - now that we removed the dependency on test/extended/util/client.go, i can approve:

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gcs278, rhamini3

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-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@rhamini3
Copy link
Contributor Author

Had a successful run run once more

/test e2e-gcp-ovn-techpreview

@gcs278
Copy link
Contributor

gcs278 commented Mar 20, 2026

Green test runs on e2e-gcp-ovn and e2e-vsphere-ovn - that means we didn't break existing (GA) CI test 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants