Skip to content

Conversation

@lihongan
Copy link
Contributor

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 30, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 30, 2025

@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.

Details

In response to this:

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.

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 openshift-ci bot requested review from Thealisyed and bentito December 30, 2025 09:50
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 30, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign candita for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@lihongan lihongan force-pushed the test-gateway-internal-lb branch from 0d9165a to 5fa6f50 Compare December 30, 2025 12:54
}

t.Logf("Creating gateway %s with infrastructure annotations...", gatewayName)
if err := kclient.Create(context.Background(), gateway); err != nil {
Copy link
Member

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.

}

// Get the service name for this gateway
serviceName := types.NamespacedName{
Copy link
Member

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: gateway

The 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.

Copy link
Contributor Author

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>
@lihongan lihongan force-pushed the test-gateway-internal-lb branch from 5fa6f50 to 060687e Compare January 5, 2026 09:22
Copy link
Member

@rikatz rikatz left a 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.

@lihongan
Copy link
Contributor Author

lihongan commented Jan 5, 2026

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 5, 2026

@lihongan: The following test 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/okd-scos-images 060687e link true /test okd-scos-images

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.

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

Labels

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