NE-2292: Tests for gatewayAPIWithoutOLM featuregate graduation#30905
NE-2292: Tests for gatewayAPIWithoutOLM featuregate graduation#30905openshift-merge-bot[bot] merged 3 commits intoopenshift:mainfrom
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
Skipping CI for Draft Pull Request. |
|
@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. 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. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds 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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
|
@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. 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. |
|
/testwith openshift/origin/main/e2e-gcp-ovn-techpreview openshift/cluster-ingress-operator#1354 |
|
CC @gcs278 |
|
If you are ready for comments, code rabbit might be worth looking at: |
|
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
test/extended/router/gatewayapicontroller.gotest/extended/util/client.go
|
Scheduling required tests: |
|
/testwith openshift/origin/main/e2e-gcp-ovn-techpreview openshift/cluster-ingress-operator#1354 |
|
/retest |
|
/testwith openshift/origin/main/e2e-gcp-ovn-techpreview openshift/cluster-ingress-operator#1354 |
|
Scheduling required tests: |
|
/testwith openshift/origin/main/e2e-gcp-ovn-techpreview openshift/cluster-ingress-operator#1354 |
|
/retest |
|
Oh forgot to put the lgtm: |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test e2e-metal-ipi-ovn-ipv6
|
|
Risk analysis has seen new tests most likely introduced by this PR. New Test Risks for sha: e8354d9
New tests seen in this PR at sha: e8354d9
|
| o.Expect(errCheck).NotTo(o.HaveOccurred(), "GatewayClass %q was not installed and accepted", gatewayClassName) | ||
|
|
||
| g.By("Confirm the istiod Deployment contains the correct managed label") | ||
| waitErr := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 5*time.Minute, false, func(context context.Context) (bool, error) { |
There was a problem hiding this comment.
Suggest to change 1*time.Second to 10*time.Second
|
/retest-required |
| } | ||
|
|
||
| func checkIstiodExists(oc *exutil.CLI, namespace string, name string) error { | ||
| waitErr := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 5*time.Minute, false, func(context context.Context) (bool, error) { |
There was a problem hiding this comment.
same as the above, suggest to change 1*time.Second to 5*time.Second or 10*time.Second
|
Job Failure Risk Analysis for sha: e8354d9
Risk analysis has seen new tests most likely introduced by this PR. New Test Risks for sha: e8354d9
New tests seen in this PR at sha: e8354d9
|
|
/test e2e-gcp-ovn-techpreview |
|
/test e2e-aws-ovn-single-node-techpreview |
| if err != nil && strings.Contains(err.Error(), "the server doesn't have a resource type") { | ||
| return | ||
| } | ||
|
|
||
| o.Expect(err).NotTo(o.HaveOccurred(), "Failed to query %s with label %s in namespace %s", resourceType, labelSelector, expectedSubscriptionNamespace) | ||
| o.Expect(strings.TrimSpace(output)).To(o.BeEmpty(), | ||
| "Expected no Sail Operator %s with label %s in namespace %s, but found:\n%s", resourceType, labelSelector, expectedSubscriptionNamespace, output) |
There was a problem hiding this comment.
Maybe we can change it to the following, just in order to remove return
if !(err != nil && strings.Contains(err.Error(), "the server doesn't have a resource type")) {
o.Expect(err).NotTo(o.HaveOccurred(), "Failed to query %s with label %s in namespace %s", resourceType, labelSelector, expectedSubscriptionNamespace)
o.Expect(strings.TrimSpace(output)).To(o.BeEmpty(),
"Expected no Sail Operator %s with label %s in namespace %s, but found:\n%s", resourceType, labelSelector, expectedSubscriptionNamespace, output)
}
| istioFound = true | ||
| if value, ok := crd.Labels["ingress.operator.openshift.io/owned"]; ok && value == "true" { | ||
| e2e.Logf("CRD %s has the specific label value: %s", crd.Name, value) | ||
| continue |
There was a problem hiding this comment.
Since the istiod is found and owned by CIO, should the continue be changed to break? No need check other crds.
There was a problem hiding this comment.
this check is to check each and every istio CRD to confirm that they are all managed by CIO
|
Job Failure Risk Analysis for sha: e8354d9
Risk analysis has seen new tests most likely introduced by this PR. New Test Risks for sha: e8354d9
New tests seen in this PR at sha: e8354d9
|
|
/verified by e2e |
|
@rhamini3: This PR has been marked as verified by 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. |
|
e2e-metal-ipi-ovn-ipv6 is permafailing since yesterday. I feel confident this PR will have no impact because we skip all gateway API tests for non-cloud platforms. To prove it's skipping, here's an example from a successful /override e2e-metal-ipi-ovn-ipv6 |
|
/override ci/prow/e2e-metal-ipi-ovn-ipv6 |
|
@gcs278: gcs278 unauthorized: /override is restricted to Repo administrators, approvers in top level OWNERS file, and the following github teams:openshift: openshift-release-oversight openshift-staff-engineers openshift-sustaining-engineers. 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 kubernetes-sigs/prow repository. |
|
@gcs278: gcs278 unauthorized: /override is restricted to Repo administrators, approvers in top level OWNERS file, and the following github teams:openshift: openshift-release-oversight openshift-staff-engineers openshift-sustaining-engineers. 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 kubernetes-sigs/prow repository. |
|
Job Failure Risk Analysis for sha: e8354d9
Risk analysis has seen new tests most likely introduced by this PR. New Test Risks for sha: e8354d9
New tests seen in this PR at sha: e8354d9
|
|
/override ci/prow/e2e-metal-ipi-ovn-ipv6 |
|
@knobunc: Overrode contexts on behalf of knobunc: ci/prow/e2e-metal-ipi-ovn-ipv6 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 kubernetes-sigs/prow repository. |
|
@rhamini3: The following tests failed, say
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. |
ffec556
into
openshift:main
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.