8000 Add support for Envoy CustomResponse LocalReply in HTTPProxy CRDs by usiegj00 · Pull Request #6974 · projectcontour/contour · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for Envoy CustomResponse LocalReply in HTTPProxy CRDs #6974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

usiegj00
Copy link

This change enables Contour HTTPProxy CRDs to support matching internal response codes and replacing them with custom user-provided responses. This is particularly useful for cases where pods selected by a service are not-ready, allowing custom pages to be shown instead of the default 503 Unhealthy Upstream response.

Fixes #320

This change enables Contour HTTPProxy CRDs to support matching internal response codes and replacing them with custom user-provided responses. This is particularly useful for cases where pods selected by a service are not-ready, allowing custom pages to be shown instead of the default 503 Unhealthy Upstream response.

Fixes projectcontour#320

Signed-off-by: Jonathan Siegel <248302+usiegj00@users.noreply.github.com>
@usiegj00 usiegj00 requested a review from a team as a code owner March 27, 2025 20:02
@usiegj00 usiegj00 requested review from tsaarni and sunjayBhatia and removed request for a team March 27, 2025 20:02
@sunjayBhatia sunjayBhatia requested review from a team, rajatvig and davinci26 and removed request for a team March 27, 2025 20:02
Copy link

Hi @usiegj00! Welcome to our community and thank you for opening your first Pull Request. Someone will review it soon. Thank you for committing to making Contour better. You can also join us on our mailing list and in our channel in the Kubernetes Slack Workspace

Signed-off-by: Jonathan Siegel <248302+usiegj00@users.noreply.github.com>
@usiegj00 usiegj00 force-pushed the issue-320-custom-response-local-reply branch from 6151d8c to 2e20bb4 Compare March 28, 2025 07:20
@tsaarni
Copy link
Member
tsaarni commented Mar 28, 2025

Hi @usiegj00, thank you for your contribution!

Could you please add the changelog to the file changelogs/unreleased/6974-usiegj00-small.md using markdown format? You can refer to the example here. Additionally, the changelog could link to the paragraph you added to the documentation. The link will be https://projectcontour.io/docs/main/config/request-routing/#response-override-policy.

Signed-off-by: Jonathan Siegel <248302+usiegj00@users.noreply.github.com>
@tsaarni tsaarni added the release-note/small A small change that needs one line of explanation in the release notes. label Mar 28, 2025
Signed-off-by: Jonathan Siegel <248302+usiegj00@users.noreply.github.com>
@tsaarni
Copy link
Member
tsaarni commented Mar 28, 2025

You can likely resolve the code generation error by running make generate and committing the generated files. See also here.

… explicit with a new helper.

Signed-off-by: Jonathan Siegel <248302+usiegj00@users.noreply.github.com>
Copy link

The Contour project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 14d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, the PR is closed

You can:

  • Ensure your PR is passing all CI checks. PRs that are fully green are more likely to be reviewed. If you are having trouble with CI checks, reach out to the #contour channel in the Kubernetes Slack workspace.
  • Mark this PR as fresh by commenting or pushing a commit
  • Close this PR
  • Offer to help out with triage

Please send feedback to the #contour channel in the Kubernetes Slack

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 12, 2025
@usiegj00
Copy link
Author
usiegj00 commented Apr 12, 2025 via email

@tsaarni tsaarni removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 12, 2025
…e limit

Fix the ResponseOverridePolicy implementation to correctly handle response body content in HTTP error responses. Standardize RuntimeKey handling to use empty strings with consistent commenting. Add a 4KB size limit to Inline response body field to balance expressive content with avoiding CRD bloat.

Fixes projectcontour#6974

Signed-off-by: Jonathan Siegel <248302+usiegj00@users.noreply.github.com>
@usiegj00 usiegj00 requested a review from sunjayBhatia May 10, 2025 16:57
Copy link
codecov bot commented May 12, 2025

Codecov Report

Attention: Patch coverage is 97.70992% with 6 lines in your changes missing coverage. Please review.

Project coverage is 81.25%. Comparing base (63653b0) to head (805443b).
Report is 46 commits behind head on main.

Files with missing lines Patch % Lines
internal/envoy/v3/listener.go 98.44% 2 Missing and 1 partial ⚠️
internal/xdscache/v3/listener.go 84.21% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6974      +/-   ##
==========================================
+ Coverage   80.72%   81.25%   +0.53%     
==========================================
  Files         131      130       -1     
  Lines       19868    19918      +50     
==========================================
+ Hits        16039    16185     +146     
+ Misses       3537     3446      -91     
+ Partials      292      287       -5     
Files with missing lines Coverage Δ
internal/dag/dag.go 98.78% <ø> (ø)
internal/dag/httpproxy_processor.go 91.24% <100.00%> (+0.24%) ⬆️
internal/protobuf/helpers.go 93.54% <100.00%> (+1.24%) ⬆️
internal/envoy/v3/listener.go 98.31% <98.44%> (+0.03%) ⬆️
internal/xdscache/v3/listener.go 91.32% <84.21%> (-0.39%) ⬇️

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/small A small change that needs one line of explanation in the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to specify custom error page
3 participants
0