Skip to content

ListenerSet adjust PortNumber kubebuilder validations #3750

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dprotaso
Copy link
Contributor

@dprotaso dprotaso commented Apr 14, 2025

  • set proper min/max value for listenerentry.port
  • adjust kubebuilder annotations for PortNumber to accomodate ListenerSet changes
PortNumber for ListenerEntry now supports setting to 0 - implying a port is randomly chosen by the implementation

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Apr 14, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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 kind/gep PRs related to Gateway Enhancement Proposal(GEP) size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 14, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 17, 2025
@dprotaso dprotaso changed the title [wip] adjust PortNumber kubebuilder validations ListenerSet adjust PortNumber kubebuilder validations Apr 17, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 17, 2025
dprotaso added a commit to dprotaso/gateway-api that referenced this pull request Apr 17, 2025
dprotaso added a commit to dprotaso/gateway-api that referenced this pull request Apr 17, 2025
dprotaso added a commit to dprotaso/gateway-api that referenced this pull request Apr 17, 2025
@dprotaso dprotaso mentioned this pull request Apr 17, 2025
@dprotaso dprotaso force-pushed the listenerset-port-number branch from f0f9284 to 2797f27 Compare April 17, 2025 05:41
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 17, 2025
@dprotaso
Copy link
Contributor Author

dprotaso commented May 6, 2025

bump

Copy link
Member

@mlavacca mlavacca left a comment

Choose a reason for hiding this comment

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

k8s-ci-robot pushed a commit that referenced this pull request Jun 11, 2025
* formatting

* clarify optional port semantics

* clarify listener name semantics

* clarify attachment/grants semantics

- Route attachment without sectionName
- re-order policy attachment section
- include a section about ReferenceGrants

* set proper min/max value for listenerentry.port

We had to drop the use of the PortNumber type because of
limitations with overriding min max using kubebuilder
annotations

* Update geps/gep-1713/index.md

Co-authored-by: Nick Young <inocuo@gmail.com>

* Drop validation markers this is handled in another PR

See: #3750

* address Nick's feedback

* remove stray backtick

* address Rob's feedback

* incorporate gep changes into godoc

---------

Co-authored-by: Nick Young <inocuo@gmail.com>
@dprotaso dprotaso force-pushed the listenerset-port-number branch from bbdc171 to 2314651 Compare June 13, 2025 16:42
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2025
dprotaso added 2 commits June 13, 2025 12:44
controller-tools only allows this to work on object types and not ref types
@dprotaso dprotaso force-pushed the listenerset-port-number branch from 2314651 to ee12cc7 Compare June 13, 2025 16:46
@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 13, 2025
@dprotaso
Copy link
Contributor Author

rebased

@mlavacca hey - currently there are no tests - I'm going to do this in a follow up when I add conformance tests etc.

@dprotaso
Copy link
Contributor Author

/assign @youngnick @robscott

who wanted me to pull this out of 1.3

//
// +optional
//
// +kubebuilder:default=0
Copy link
Contributor

Choose a reason for hiding this comment

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

If the default is now 0, is this not a backward compatible change once it goes to standard? Formerly the port was optional, so there could be widespread omitted-port cases that were already properly handled. Now there could be a completely different way that missing ports are handled. Do we need to worry about that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the default is now 0, is this not a backward compatible change once it goes to standard?

I don't think so the ListenerSet is an alpha API so I believe we can make these changes.

Formerly the port was optional

It wasn't actually - maybe that's the confusion here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/gep PRs related to Gateway Enhancement Proposal(GEP) release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants