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

BackendTLSPolicy TargetRef SectionName should support port name #3474

Open
zhaohuabing opened this issue Nov 25, 2024 · 2 comments
Open

BackendTLSPolicy TargetRef SectionName should support port name #3474

zhaohuabing opened this issue Nov 25, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@zhaohuabing
Copy link
Contributor

zhaohuabing commented Nov 25, 2024

What happened:

The LocalPolicyTargetReferenceWithSectionName requires the sectionName for Service to be the port name. However, port name is an optional feild in the Service spec. Instead, the port number should be used for the SectionName of Service, or ideally, both Port name and Port number could be supported as the sectionName for Service.

What you expected to happen:

LocalPolicyTargetReferenceWithSectionName uses port number for the SectionName for Service.

Related EG issue: envoyproxy/gateway#4769

@zhaohuabing zhaohuabing added the kind/bug Categorizes issue or PR as related to a bug. label Nov 25, 2024
@howardjohn
Copy link
Contributor

Port is only optional if there is exactly 1 port IIRC, so technically you would not need sectionName in that case?

That being said, it may be more robust to explicitly target the single port, so that if an additional port is added later it isn't accidentally included?

@zhaohuabing
Copy link
Contributor Author

zhaohuabing commented Nov 26, 2024

Port is only optional if there is exactly 1 port IIRC, so technically you would not need sectionName in that case?

Ha, I haven't noticed that it's "conditional" optional, so technically we don't need sectionName for that :-)

That being said, it may be more robust to explicitly target the single port, so that if an additional port is added later it isn't accidentally included?

This kind of makes sense, but it's not a critical issue.

Additionally, since the BackendObjectReference API uses the port number , should the LocalPolicyTargetReferenceWithSectionName API also use the port number for consistency? It would also simplify the implementation, as it would allow directly matching a policy against the BackendRef without the need to resolve the service port to its name.

I'll keep this issue open for a while to allow for further discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants