Skip to content

test(gatewayapi): BackendTLSPolicy lookup does not prefer sectionName-specific match over wildcard#9034

Closed
AlecDiraimondo wants to merge 1 commit into
envoyproxy:mainfrom
AlecDiraimondo:repro/backendtlspolicy_shadowing_potential_bug
Closed

test(gatewayapi): BackendTLSPolicy lookup does not prefer sectionName-specific match over wildcard#9034
AlecDiraimondo wants to merge 1 commit into
envoyproxy:mainfrom
AlecDiraimondo:repro/backendtlspolicy_shadowing_potential_bug

Conversation

@AlecDiraimondo

@AlecDiraimondo AlecDiraimondo commented May 19, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

This PR adds testcase and golden config to reproduce issue #9035

What this PR does / why we need it:

Adds a translator test case that locks in the current (buggy) behavior of BackendTLSPolicy lookup: when two policies target the same Service — one with targetRefs[].sectionName set and one without — the
wildcard (no sectionName) policy shadows the sectioned one if it sorts earlier in the resource list (which happens whenever it has an older creationTimestamp).

The golden output captures the broken state: policy-sectioned.status.ancestors is null, and both routes (including the one on the section the sectioned policy targets) end up with the wildcard policy's TLS
config. When the precedence fix lands, the output will need to be regenerated and the diff will be a clean visual proof of the fix.

Which issue(s) this PR fixes:

N/A. Asserts behavior in #9035

Release Notes: Yes/No

@AlecDiraimondo AlecDiraimondo requested a review from a team as a code owner May 19, 2026 22:05
@netlify

netlify Bot commented May 19, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit f3bf3e4
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a0cde948ae65b0008563228
😎 Deploy Preview https://deploy-preview-9034--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3bf3e450f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

name: ca-cmap
hostname: sectioned.example.com
status:
ancestors: null

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Encode spec-expected precedence in golden output

This golden file currently asserts the known-bug outcome (policy-sectioned has no accepted ancestor), even though the paired input comments state the spec-expected behavior is that the sectioned policy should win for its matching port. Because TestTranslate compares against this .out.yaml, the new case will pass while preserving the incorrect precedence logic, so it does not protect against the real regression and can block a later fix by treating correct behavior as a failure.

Useful? React with 👍 / 👎.

@AlecDiraimondo AlecDiraimondo changed the title test(gatewayapi): BackendTLSPolicy precedence logic repro - wildcard shadows exact sectionName match test(gatewayapi): BackendTLSPolicy lookup does not prefer sectionName-specific match over wildcard May 19, 2026
@AlecDiraimondo AlecDiraimondo marked this pull request as draft May 20, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant