Fix populate client max body size on VirtualServer Route match #8283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This fixes #7332 which when using virtual server/routes with a match condition then the max body size of the upstream is ultimately lost as nginx doesn't inherit from the sub locations, this PR adds it to the internal redirect location (the parent).
I couldn't see another way for this to work other than creating an issue against nginx, but there's no guarantees that would be accepted as I would imagine instant parameter inheritance in a version might break existing systems that are expected to work in the current way.
Some edge cases to this implementation;
I've added the initial unit tests, I haven't added the template test (I guess this is still worthwhile to prevent this breaking/removal in the future) - I wanted to gauge if it's also worth while adding to the suite tests? (which the helm template looks to be broke in the main branch currently)
Checklist
Before creating a PR, run through this checklist and mark each as complete.