Skip to content
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

Ensure listener name must be unique within a Gateway #1854

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

muyuan0
Copy link
Contributor

@muyuan0 muyuan0 commented Mar 20, 2023

Signed-off-by: muyuan0 [email protected]

What type of PR is this?

/kind bug

What this PR does / why we need it:

Check if the listener names are unique within a Gateway

Which issue(s) this PR fixes:

Fixes #1845

Does this PR introduce a user-facing change?:

NONE

@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/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. kind/bug Categorizes issue or PR as related to a bug. labels Mar 20, 2023
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 20, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 20, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @muyuan0!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 20, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @muyuan0. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 20, 2023
@muyuan0 muyuan0 marked this pull request as ready for review March 20, 2023 09:41
@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 Mar 20, 2023

// ValidateListenerNames validates the names of the listeners
// must be unique within the Gateway
func ValidateListenerNames(listeners []gatewayv1b1.Listener, path *field.Path) field.ErrorList {
Copy link
Contributor

Choose a reason for hiding this comment

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

This func should be called by validateGatewayListeners() to be included in the admission webhook.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in the validateGatewayListeners above

@dprotaso
Copy link
Contributor

I think we should sort out some of the discussions in the following related issues prior to merging this change

#1842
#1713

@shaneutt
Copy link
Member

I think we should sort out some of the discussions in the following related issues prior to merging this change

#1842 #1713

So just to be clear you're asking that this PR be put on hold until both #1842 and #1713 are resolved?

@dprotaso
Copy link
Contributor

dprotaso commented Mar 20, 2023 via email

@shaneutt
Copy link
Member

Yeah.

I'm not feeling very compelled to block here, it seems unique listener name checking is something we would want in any case, no?

Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks @muyuan0 !

@robscott
Copy link
Member

@dprotaso I'm not sure I see the connection between this and the issues you linked, can you help clarify why they should block this?

@dprotaso
Copy link
Contributor

Yeah #1842 doesn't apply to Name (SectionName) - my mistake

For #1713 I wondered if we're merging Gateways would we allow listeners on different Gateways to merge with the same Name. A concern I had was that the validation here would prevent that but I might have been overzealous. We can have that discussion in the other GEP

Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 22, 2023
@shaneutt shaneutt added this to the v0.7.0 milestone Mar 22, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arkodg, hzxuzhonghu, muyuan0, shaneutt

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

@shaneutt shaneutt removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 22, 2023
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 22, 2023
@shaneutt shaneutt added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 22, 2023
@shaneutt
Copy link
Member

@muyuan0 just need to change your commit message as per #1854 (comment) and then we're all set 👍

@muyuan0
Copy link
Contributor Author

muyuan0 commented Mar 23, 2023

@shaneutt
Could I force push to update the commit message?

@shaneutt
Copy link
Member

shaneutt commented Mar 23, 2023

@shaneutt Could I force push to update the commit message?

Yes that's fine! Thank you!

Re-request my review when you're done 👍

@robscott
Copy link
Member

Thanks @muyuan0! This LGTM as well once the commit message is fixed.

@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. labels Mar 24, 2023
@robscott
Copy link
Member

Thanks @muyuan0!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 24, 2023
@k8s-ci-robot k8s-ci-robot merged commit 67fa2e5 into kubernetes-sigs:main Mar 24, 2023
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Listener name must be unique within a Gateway
8 participants