-
Notifications
You must be signed in to change notification settings - Fork 66
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
chore: delete default value of minAvailable #1096
Conversation
WalkthroughThis pull request introduces modifications to the EMQX Operator's CustomResourceDefinition (CRD) and associated documentation across multiple files. The primary change involves removing the default value annotation for the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Signed-off-by: Rory Z <[email protected]>
3575640
to
583e921
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/en_US/reference/v2beta1-reference.md (1)
111-111
: LGTM! Consider enhancing the documentation.The removal of the default value for
minAvailable
is appropriate since it's mutually exclusive withmaxUnavailable
. Consider adding an example to clarify the usage, such as "For example, setting '50%' ensures that at least half of the pods remain available during eviction."🧰 Tools
🪛 LanguageTool
[uncategorized] ~111-~111: A comma might be missing here.
Context: ...n the
absence of the evicted pod. So for example you can prevent all volunta...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~111-~111: A comma might be missing here.
Context: ...r />absence of the evicted pod. So for example you can prevent all voluntary
evic...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apis/apps/v2beta1/emqx_types.go
(0 hunks)config/crd/bases/apps.emqx.io_emqxes.yaml
(0 hunks)deploy/charts/emqx-operator/templates/crd.emqxes.apps.emqx.io.yaml
(0 hunks)docs/en_US/reference/v2beta1-reference.md
(2 hunks)docs/zh_CN/reference/v2beta1-reference.md
(2 hunks)
💤 Files with no reviewable changes (3)
- apis/apps/v2beta1/emqx_types.go
- config/crd/bases/apps.emqx.io_emqxes.yaml
- deploy/charts/emqx-operator/templates/crd.emqxes.apps.emqx.io.yaml
🧰 Additional context used
🪛 LanguageTool
docs/en_US/reference/v2beta1-reference.md
[uncategorized] ~111-~111: A comma might be missing here.
Context: ...n the
absence of the evicted pod. So for example you can prevent all volunta...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~111-~111: A comma might be missing here.
Context: ...r />absence of the evicted pod. So for example you can prevent all voluntary
evic...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~235-~235: A comma might be missing here.
Context: ...n the
absence of the evicted pod. So for example you can prevent all volunta...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~235-~235: A comma might be missing here.
Context: ...r />absence of the evicted pod. So for example you can prevent all voluntary
evic...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
🔇 Additional comments (3)
docs/zh_CN/reference/v2beta1-reference.md (2)
111-111
: LGTM! Documentation update for EMQXCoreTemplateSpec.minAvailable
The removal of the default value for minAvailable
field is consistent with the PR objective and maintains the correct validation rule.
235-235
: LGTM! Documentation update for EMQXReplicantTemplateSpec.minAvailable
The removal of the default value for minAvailable
field is consistent with the PR objective and maintains the correct validation rule.
docs/en_US/reference/v2beta1-reference.md (1)
235-235
: LGTM! Verify mutual exclusivity implementation.
The removal of the default value for minAvailable
in EMQXReplicantTemplateSpec
maintains consistency with EMQXCoreTemplateSpec
.
Let's verify the mutual exclusivity implementation:
✅ Verification successful
Mutual exclusivity is properly implemented in the CRD validation
The CRD validation rules correctly enforce mutual exclusivity between minAvailable
and maxUnavailable
fields through:
- A CEL validation rule:
has(self.minAvailable) && has(self.maxUnavailable) ? false : true
- A clear error message: "minAvailable cannot be set when maxUnavailable is specified. These fields are mutually exclusive in PodDisruptionBudget."
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that minAvailable and maxUnavailable are mutually exclusive in the CRD validation
# Search for the CRD validation rules
ast-grep --pattern 'oneOf {
$$$
properties {
minAvailable: $$$
}
$$$
properties {
maxUnavailable: $$$
}
$$$
}'
Length of output: 134
Script:
#!/bin/bash
# Let's try a different approach to find the CRD validation rules
# Search for files containing both minAvailable and maxUnavailable
rg -l "minAvailable.*maxUnavailable|maxUnavailable.*minAvailable" --type yaml
# Then let's examine the content of these files to verify the validation rules
rg "minAvailable|maxUnavailable" -A 5 -B 5 --type yaml
Length of output: 11606
🧰 Tools
🪛 LanguageTool
[uncategorized] ~235-~235: A comma might be missing here.
Context: ...n the
absence of the evicted pod. So for example you can prevent all volunta...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~235-~235: A comma might be missing here.
Context: ...r />absence of the evicted pod. So for example you can prevent all voluntary
evic...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1096 +/- ##
==========================================
+ Coverage 76.16% 76.38% +0.22%
==========================================
Files 69 69
Lines 6246 6246
==========================================
+ Hits 4757 4771 +14
+ Misses 1249 1240 -9
+ Partials 240 235 -5 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
New Features
v2beta1
for the EMQX CustomResourceDefinition (CRD) with enhanced properties.secretRef
inbootstrapAPIKeys
for improved security.status
section provide detailed insights into EMQX nodes.Bug Fixes
MinAvailable
, now requiring explicit definition.Documentation
v2beta1
, clarifying changes to theminAvailable
field.