Skip to content

[2.3] added max_headers_count setting to ListenerPolicy (#14188)#14207

Merged
andy-fong merged 5 commits into
kgateway-dev:v2.3.xfrom
andy-fong:af-backport-max-headers-count-2.3
Jun 9, 2026
Merged

[2.3] added max_headers_count setting to ListenerPolicy (#14188)#14207
andy-fong merged 5 commits into
kgateway-dev:v2.3.xfrom
andy-fong:af-backport-max-headers-count-2.3

Conversation

@andy-fong

@andy-fong andy-fong commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

backport of #14188

Change Type

/kind fix

Changelog

added max_headers_count setting to ListenerPolicy

Copilot AI review requested due to automatic review settings June 8, 2026 23:04
@andy-fong
andy-fong requested a review from a team as a code owner June 8, 2026 23:04
@gateway-bot gateway-bot added kind/fix Categorizes issue or PR as related to a bug. release-note labels Jun 8, 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

Backport of #14188 to the 2.3 branch adding a maxHeadersCount knob to ListenerPolicy/HTTPSettings, translating it into Envoy HCM commonHttpProtocolOptions.max_headers_count, and covering it with translator golden tests plus an e2e enforcement check.

Changes:

  • Add maxHeadersCount to the CRD + API types (with validation) and generated deepcopy.
  • Plumb/merge the setting through listenerpolicy IR and apply it onto Envoy’s HttpConnectionManager.
  • Add translator fixtures + tests, and a new e2e test + manifest validating runtime behavior.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/e2e/features/listener_policy/types.go Adds manifest path constant for the new e2e scenario.
test/e2e/features/listener_policy/testdata/listener-policy-max-headers-count.yaml New ListenerPolicy manifest setting maxHeadersCount.
test/e2e/features/listener_policy/suite.go Registers and implements TestListenerPolicyMaxHeadersCount e2e test.
pkg/kgateway/translator/gateway/testutils/outputs/listener-policy-http/max-headers-count.yaml New expected translated output verifying maxHeadersCount on HCM.
pkg/kgateway/translator/gateway/testutils/outputs/listener-policy-http/max-headers-count-with-max-requests.yaml New expected output verifying maxHeadersCount coexists with maxRequestsPerConnection.
pkg/kgateway/translator/gateway/testutils/outputs/listener-policy-http/max-headers-count-merge-conflict.yaml New expected output verifying merge/override behavior for maxHeadersCount.
pkg/kgateway/translator/gateway/testutils/inputs/listener-policy-http/max-headers-count.yaml New translator input fixture for maxHeadersCount.
pkg/kgateway/translator/gateway/testutils/inputs/listener-policy-http/max-headers-count-with-max-requests.yaml New input fixture combining maxHeadersCount + maxRequestsPerConnection.
pkg/kgateway/translator/gateway/testutils/inputs/listener-policy-http/max-headers-count-merge-conflict.yaml New input fixture to exercise merge conflict behavior.
pkg/kgateway/translator/gateway/gateway_translator_test.go Adds new translator test cases for the fixtures (currently contains a compile-breaking field name issue).
pkg/kgateway/extensions2/plugins/listenerpolicy/merge_http.go Adds merge function to combine maxHeadersCount across policies.
pkg/kgateway/extensions2/plugins/listenerpolicy/listener_plugin.go Applies maxHeadersCount onto Envoy HCM common HTTP protocol options.
pkg/kgateway/extensions2/plugins/listenerpolicy/http.go Extends IR + equality + policy translation to carry maxHeadersCount.
install/helm/kgateway-crds/templates/gateway.kgateway.dev_listenerpolicies.yaml CRD schema update adding maxHeadersCount.
install/helm/kgateway-crds/templates/gateway.kgateway.dev_httplistenerpolicies.yaml CRD schema update adding maxHeadersCount.
api/v1alpha1/kgateway/zz_generated.deepcopy.go Deepcopy update for HTTPSettings.MaxHeadersCount.
api/v1alpha1/kgateway/listener_policy_types.go API type update adding MaxHeadersCount with validation/docs.
Files not reviewed (1)
  • api/v1alpha1/kgateway/zz_generated.deepcopy.go: Language not supported

Comment thread pkg/kgateway/translator/gateway/gateway_translator_test.go Outdated
Comment thread pkg/kgateway/translator/gateway/gateway_translator_test.go Outdated
Comment thread pkg/kgateway/translator/gateway/gateway_translator_test.go Outdated
andy-fong added 4 commits June 8, 2026 19:16
Signed-off-by: Andy Fong <[email protected]>
Signed-off-by: Andy Fong <[email protected]>
Signed-off-by: Andy Fong <[email protected]>
@andy-fong
andy-fong added this pull request to the merge queue Jun 9, 2026
Merged via the queue into kgateway-dev:v2.3.x with commit 5ba104c Jun 9, 2026
31 checks passed
@andy-fong
andy-fong deleted the af-backport-max-headers-count-2.3 branch June 9, 2026 22:22
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.

4 participants