feat: allow RateLimitRedisSettings.url to be sourced from a Secret - #9143
Conversation
Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e27bf30412
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
Signed-off-by: Andrey Maltsev <guanchzhou@gmail.com>
…ter (envoyproxy#9022) Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c060f8d5c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
An optional Secret reference lets the rate limit container start even when the referenced Secret/key is absent, leaving REDIS_URL unset and global rate limiting nonfunctional instead of waiting for the externally provisioned Secret. Reject optional=true in Go config validation (with a mirrored CEL rule) so the Secret reference stays required. Addresses Codex review feedback on envoyproxy#9143. Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9143 +/- ##
==========================================
+ Coverage 75.41% 75.44% +0.03%
==========================================
Files 252 252
Lines 41660 41691 +31
==========================================
+ Hits 31416 31454 +38
+ Misses 8115 8108 -7
Partials 2129 2129 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
Covers the patch-coverage gaps flagged by Codecov: nil redis settings, non-NotFound Secret get errors, the TLS certificateRef path in ratelimit.Validate, and ValidateRedisURL called directly. Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
|
you didn't need to rebase frequently, the maintainer will do that if needed before merging. |
# Conflicts: # release-notes/current.yaml
| // Mutually exclusive with URLRef. | ||
| // | ||
| // +optional | ||
| URL string `json:"url,omitempty"` |
There was a problem hiding this comment.
this needs to be made a ptr
There was a problem hiding this comment.
hey @guanchzhou can you address this as a follow up
* api: make RateLimitRedisSettings.url a pointer Follow-up to #9143. url became optional (mutually exclusive with urlRef) but stayed a non-pointer string, so an unset value could not be distinguished from an explicit empty string. Make it *string so nil means unset, per review feedback. Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com> * api: use ptr.Deref for redis URL presence check Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com> --------- Signed-off-by: Andrey Maltsev <maltsev.andrey@gmail.com>
What type of PR is this?
feat
What this PR does / why we need it:
Adds an optional
urlReffield toRateLimitRedisSettings, mutually exclusive withurl, that sources the global rate limit Redis URL from a Kubernetes Secret key:This unblocks GitOps workflows where the Redis endpoint is provisioned dynamically by an external controller (e.g. Crossplane writes a connection Secret) rather than baked into the EnvoyGateway config as a literal string.
Design notes:
REDIS_URLviavalueFrom.secretKeyRef, so the control plane never reads the secret value (mirrors how the Redis password is already injected). The referenced Secret must exist in the Envoy Gateway namespace.tls.certificateRef(Secret-only) precedent.configMapKeyRefcan be added later as a non-breaking addition.url/urlRefis enforced by a struct-level CEL rule (has(self.url) != has(self.urlRef)) and mirrored in Go config validation.urlbecomes optional but remains fully backward-compatible.Validate()Secret/key existence check, unit + golden deployment tests, regenerated API reference, a docs example, and a release note.Which issue(s) this PR fixes:
Fixes #9022
Release Notes: Yes