-
Notifications
You must be signed in to change notification settings - Fork 218
NE-2374: Add e2e test for Gateway API infrastructure annotations #1331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@lihongan: This pull request references NE-2374 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
0d9165a to
5fa6f50
Compare
test/e2e/gateway_api_test.go
Outdated
| } | ||
|
|
||
| t.Logf("Creating gateway %s with infrastructure annotations...", gatewayName) | ||
| if err := kclient.Create(context.Background(), gateway); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use createWithRetryOnError to avoid flakes from network issues.
test/e2e/gateway_api_test.go
Outdated
| } | ||
|
|
||
| // Get the service name for this gateway | ||
| serviceName := types.NamespacedName{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a big deal so feel free to ignore this comment, but I would probably use the label selector instead of the service name:
gateway.networking.k8s.io/gateway-class-name: istio
gateway.networking.k8s.io/gateway-name: gatewayThe reason is that we can't really control how Istio or other implementations will create a service name (eg.: they may truncate it because the sum of a class name and a gateway name are too big) but the labels will always be there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, using label selector is better.
But I just see the two labels as
labels:
gateway.istio.io/managed: openshift.io-gateway-controller-v1
gateway.networking.k8s.io/gateway-name: test-gateway
The first one is not gateway-class-name and seems it is from the controller name
$ oc get gatewayclass
NAME CONTROLLER ACCEPTED AGE
openshift-default openshift.io/gateway-controller/v1 True 10m
Anyway, I will try to use label selector here. Thanks
Adds testGatewayAPIInfrastructureAnnotations to verify that annotations specified in Gateway.Spec.Infrastructure.Annotations are correctly propagated to the underlying Service resource. The test is AWS-specific and validates the internal load balancer annotation behavior. Improvements: - Uses createWithRetryOnError for more reliable gateway creation - Uses label selectors to find the service instead of constructing the service name, matching the pattern used by gateway-service-dns controller - Properly converts controller name to Istio managed label value 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
5fa6f50 to
060687e
Compare
rikatz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good, thanks!!
I will check if someone else wants to do a 2nd pass.
|
/retest-required |
|
@lihongan: The following test 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. |
Adds testGatewayAPIInfrastructureAnnotations to verify that annotations specified in Gateway.Spec.Infrastructure.Annotations are correctly propagated to the underlying Service resource.
The test is AWS-specific and validates the internal load balancer annotation behavior.