Skip to content

[gw api] add TLS and UDP listener tests. Fix bugs that were found from the tests #4250

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

Merged
merged 2 commits into from
Jun 30, 2025

Conversation

zac-nixon
Copy link
Collaborator

Description

Adds new GW API E2E tests that validate UDP and TLS listener types. While developing these tests, they found multiple bugs that I have fixed.

Ran 4 of 4 Specs in 1334.285 seconds
SUCCESS! -- 4 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS

Bugs fixed:

  • TLS listeners didn't accept TCP routes, for TLS termination use cases.
  • Target Groups only used the namespaced name for resource key, this meant that duplicate route names with different types incorrectly de-duped. This was fixed by adding the route kind to route name and resource key.

Next steps:

  • Fix 'infinite' reconcile bug when a route is partially accepted.
  • Add additional tests that validate TLS -> TLS communication, currently the test does TLS termination at the NLB level.
  • Add in multi-backend support in order to support things that TCP_UDP listener.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 27, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zac-nixon

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 27, 2025
@zac-nixon zac-nixon force-pushed the znixon/more-integration branch from 8bdf40c to dfbdc73 Compare June 27, 2025 23:07
@zac-nixon zac-nixon force-pushed the znixon/more-integration branch from dfbdc73 to 8e94684 Compare June 27, 2025 23:48
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 27, 2025
if tg, exists := t.tgByResID[tgResID]; exists {
fmt.Println("TG already exists. Returning cached version")
Copy link
Collaborator

Choose a reason for hiding this comment

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

forgot to delete?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ya

@@ -68,7 +68,7 @@ func Test_buildTargetGroupSpec(t *testing.T) {
},
},
expectedTgSpec: elbv2model.TargetGroupSpec{
Name: "k8s-myrouten-myroute-d02da2803b",
Name: "k8s-myrouten-myroute-8d8111f6ac",
Copy link
Collaborator

Choose a reason for hiding this comment

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

what are those values, when do they need to be changed? is it because we added routeKind this time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, it is because the kind is added to the name,. the value is just the hash of a bunch of fields.

},
targetPort: intstr80,
healthCheckPort: intstrTrafficPort,
tgProtocol: elbv2model.ProtocolHTTP,
Copy link
Collaborator

Choose a reason for hiding this comment

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

why we changed from TCP protocol to HTTP?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's using the TG protocol, so testing out various protocols get translated correctly to TCP. Previously we were just using the service port.

var defaultProtocolToRouteKindMap = map[gwv1.ProtocolType][]RouteKind{
gwv1.TCPProtocolType: {TCPRouteKind},
gwv1.UDPProtocolType: {UDPRouteKind},
gwv1.TLSProtocolType: {TLSRouteKind, TCPRouteKind},
Copy link
Collaborator

Choose a reason for hiding this comment

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

i might missed it, other than the kindCheck, did we also check somewhere that TLS protocol can only use TCPRoute when mode=terminate

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point. fixed.

@shuqz
Copy link
Collaborator

shuqz commented Jun 30, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 30, 2025
@shraddhabang
Copy link
Collaborator

/lgtm
/approved

@k8s-ci-robot k8s-ci-robot merged commit fbc6b19 into kubernetes-sigs:main Jun 30, 2025
9 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants