Skip to content

fix(listenerpolicy): merge clientCertificateValidation to get correct attachment status#14278

Merged
puertomontt merged 1 commit into
kgateway-dev:mainfrom
marvin-roesch:fix/listener-policy-client-validation-merge
Jun 24, 2026
Merged

fix(listenerpolicy): merge clientCertificateValidation to get correct attachment status#14278
puertomontt merged 1 commit into
kgateway-dev:mainfrom
marvin-roesch:fix/listener-policy-client-validation-merge

Conversation

@marvin-roesch

Copy link
Copy Markdown
Contributor

Description

By (shallow-)merging the policy configuration, the policy gets correctly marked as attached.

Related issues: Fixes #14277

Change Type

/kind fix

Changelog

Fix ListenerPolicy with `clientCertificateValidation` not being marked as `Attached` if there are other policies applied to the same target

Copilot AI review requested due to automatic review settings June 22, 2026 06:17
@marvin-roesch
marvin-roesch force-pushed the fix/listener-policy-client-validation-merge branch from 9d9e9a9 to 0d1666b Compare June 22, 2026 06:18
@gateway-bot gateway-bot added kind/fix Categorizes issue or PR as related to a bug. release-note labels Jun 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes ListenerPolicy attachment status reporting by including clientCertificateValidation in the ListenerPolicy merge logic, so a policy that only configures client certificate validation is still considered “merged/attached” when other ListenerPolicies apply to the same target.

Changes:

  • Add clientCertificateValidation to the ListenerPolicy merge pipeline and record merge origins for it.
  • Add a new gateway translator regression test case and corresponding input/output golden YAML fixtures.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
pkg/kgateway/extensions2/plugins/listenerpolicy/merge.go Adds merge support for clientCertificateValidation so it contributes to merged policy state and attachment status.
pkg/kgateway/translator/gateway/gateway_translator_test.go Adds a translator test case for per-listener mTLS + policy merging.
pkg/kgateway/translator/gateway/testutils/inputs/listener-policy/per-listener-mtls-merge.yaml New test input fixture covering multiple policies attached to the same listener.
pkg/kgateway/translator/gateway/testutils/outputs/listener-policy/per-listener-mtls-merge.yaml New golden output verifying merged origins metadata and Attached conditions.

Comment thread pkg/kgateway/translator/gateway/gateway_translator_test.go
@marvin-roesch
marvin-roesch force-pushed the fix/listener-policy-client-validation-merge branch from 0d1666b to 0878f88 Compare June 22, 2026 07:00
@puertomontt
puertomontt requested a review from alexliu541 June 24, 2026 11:06

@alexliu541 alexliu541 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

@puertomontt
puertomontt added this pull request to the merge queue Jun 24, 2026
Merged via the queue into kgateway-dev:main with commit b54419a Jun 24, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/fix Categorizes issue or PR as related to a bug. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clientCertificateValidation-only ListenerPolicy does not get Attached status when attached alongside other ListenerPolicies

5 participants