feat(decoredirect): add redirectCode field (301|307) and opt-in X-Redirect-By header#17
Merged
Merged
Conversation
nicacioliveira
previously approved these changes
May 28, 2026
…header Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ect-By header Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Redirect Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…directCode Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ator Prevents cleanTemplates() from deleting the hand-placed ConfigMap on every make generate run by adding an addRedirectCustomHeaders generator function. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f7e3650 to
14f34d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
redirectCodeoptional field toDecoRedirectCRD — accepts301or307(kubebuilder enum, validated by API server), defaults to307. The controller setsnginx.ingress.kubernetes.io/permanent-redirect-codeper-Ingress from this value.redirectCodein the operator management HTTP API (POST body and GET/LIST response).X-Redirect-Byresponse header: whenredirect.decoHeader.enabled=true, the Helm chart creates adeco-custom-headersConfigMap and nginx reads it viaadd-headers. Value is configurable (redirect.decoHeader.value, default"deco"). ANOTES.txtwarning fires ifenabled=truebutadd-headersis not wired.Notes
decoHeaderfeature requires two values to be set together (redirect.decoHeader.enabled=true+ingress-nginx.controller.config.add-headers); Helm subchart value templating doesn't allow auto-wiring, so theNOTES.txtwarning bridges the gap.Test Plan
make testpasses (all controller + API tests green)helm lint chart/passeshelm template --set redirect.decoHeader.enabled=truerendersdeco-custom-headersConfigMaphelm template(defaults) renders nodeco-custom-headers/redirectswithredirectCode: 301stores and returns 301/redirectswithredirectCode: 302returns 422/redirectswithoutredirectCodedefaults to 307🤖 Generated with Claude Code
Summary by cubic
Adds an optional redirectCode (301 or 307; default 307) to DecoRedirect, passes it through the HTTP API and controller to set the NGINX per-Ingress redirect code, and adds opt-in custom response headers via Helm. Also ignores values-local.yaml.
New Features
Migration
Written for commit 14f34d4. Summary will update on new commits.