api: add cel validation of GrpcStatus#8803
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 canceled.
|
| // +optional | ||
| GrpcStatus *int32 `json:"grpcStatus,omitempty"` | ||
| // +kubebuilder:validation:Minimum=0 | ||
| // +kubebuilder:validation:Maximum=16 |
There was a problem hiding this comment.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f661cda5a4
ℹ️ 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".
| GrpcStatus *int32 `json:"grpcStatus,omitempty"` | ||
| // +kubebuilder:validation:Minimum=0 | ||
| // +kubebuilder:validation:Maximum=16 | ||
| GrpcStatus *uint32 `json:"grpcStatus,omitempty"` |
There was a problem hiding this comment.
Keep grpcStatus signed to avoid upgrade decode breakage
Changing grpcStatus from *int32 to *uint32 is a backward-incompatible API shape change for stored CRs: clusters could already have BackendTrafficPolicy objects with negative grpcStatus values (previously allowed before the new bounds), and those objects will fail to decode into the typed client/controller after upgrade. This can surface as informer/list/watch decode errors and block reconciliation for affected resources. You can enforce the new valid range without this break by keeping the Go type as int32 and relying on Minimum=0/Maximum=16 validation.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8803 +/- ##
==========================================
- Coverage 74.40% 74.40% -0.01%
==========================================
Files 245 245
Lines 38973 38977 +4
==========================================
+ Hits 28998 28999 +1
- Misses 7971 7974 +3
Partials 2004 2004 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
f661cda to
3b79171
Compare
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ 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". |
What this PR does / why we need it:
Improve: add validation of valid values.
Related: #8800
Which issue(s) this PR fixes:
Fixes #
Release Notes: No