Skip to content

Conversation

@ciarams87
Copy link
Contributor

@ciarams87 ciarams87 commented Nov 13, 2025

Proposed changes

Problem: We need to implement the ProxySettingsPolicy API

Solution: Implement ProxySettingsPolicy

Manual Testing: Tested using the example files provided which will be the basis of the documentation:
Steps (using the provided examples):

  • Deploy an application which returns a large payload (coffee) and one which does not (tea)
  • Apply the PSP for the Gateway which will support the smaller payload application
  • Verify tea works but coffee does not (response too large error in NGINX logs)
  • Apply the PSP for the coffee route which increases the proxy buffer size
  • Verify coffee now works (note: return output to file if testing this as it fills the terminal)

Also tested the validation works as expected.

Note that the Programmed status implementation, CEL, and functional testing will all be done in follow up PRs

Closes #4261

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.


@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request helm-chart Relates to helm chart labels Nov 13, 2025
@ciarams87 ciarams87 marked this pull request as ready for review November 14, 2025 14:14
@ciarams87 ciarams87 requested a review from a team as a code owner November 14, 2025 14:14
Copy link
Collaborator

@sjberman sjberman left a comment

Choose a reason for hiding this comment

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

Nice work!


// parseNginxSize parses an NGINX size string (e.g., "8k", "16m", "1024") and returns the size in bytes.
// Returns an error if the size string is invalid.
func parseNginxSize(size string) (int64, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we have a dedicated unit test for this function?

// HTTP2 should be enabled by default
HTTP2: true,
IPFamily: Dual,
Policies: buildPolicies(gateway, gateway.Policies),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this going to build client settings policies objects too and attach to this struct?

Comment on lines 134 to +135
// PolicyAffectedReason is used with the "PolicyAffected" condition when a
// ObservabilityPolicy or ClientSettingsPolicy is applied to Gateways or Routes.
// ObservabilityPolicy, ClientSettingsPolicy, or ProxySettingsPolicy is applied to Gateways or Routes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does PolicyAffectedReason only apply to these three policies?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request helm-chart Relates to helm chart

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

4 participants