reconcile: delete statefulset pods when maxUnavailable set to 100%#1815
Open
AndrewChubatiuk wants to merge 2 commits intomasterfrom
Open
reconcile: delete statefulset pods when maxUnavailable set to 100%#1815AndrewChubatiuk wants to merge 2 commits intomasterfrom
AndrewChubatiuk wants to merge 2 commits intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
3 issues found across 15 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/controller/operator/factory/reconcile/statefulset.go">
<violation number="1" location="internal/controller/operator/factory/reconcile/statefulset.go:171">
P0: Nil pointer dereference: `cr.UpdateBehavior` can be nil here. The nil guard on line 160 only protects the `GetScaledValueFromIntOrPercent` call, but this new check is outside that guard. When no `UpdateBehavior` is configured (the default), this will panic at runtime.</violation>
<violation number="2" location="internal/controller/operator/factory/reconcile/statefulset.go:373">
P1: Variable shadowing bug: inner `var pod corev1.Pod` (line 373) shadows the outer `var pod *corev1.Pod` (line 371). The outer `pod` remains nil forever, making `podStatusesToError` dead code. On poll timeout, the enriched error diagnostics (pod phase, conditions, container crash states) are silently lost. Change the inner declaration to assign to the outer variable, as the old code did.</violation>
</file>
<file name="docs/CHANGELOG.md">
<violation number="1" location="docs/CHANGELOG.md:31">
P3: Fix the typo "importaint" → "important" in this changelog entry to keep documentation polished.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
74ff139 to
5aa6847
Compare
5aa6847 to
9ec51c5
Compare
Contributor
Author
|
@cubic-dev-ai review this PR |
Contributor
@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete. |
Contributor
There was a problem hiding this comment.
2 issues found across 3 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/CHANGELOG.md">
<violation number="1" location="docs/CHANGELOG.md:31">
P2: Custom agent: **Changelog Review Agent**
The new changelog entry doesn’t follow the required structure: it lacks an explicit before/now user-visible explanation and focuses on implementation details (deletion vs eviction). The Changelog Review Agent rule requires a user-centric before/after description of the impact.</violation>
</file>
<file name="internal/controller/operator/factory/reconcile/statefulset.go">
<violation number="1" location="internal/controller/operator/factory/reconcile/statefulset.go:165">
P2: The delete mode won’t activate for the intended "100%" maxUnavailable because IntValue() returns 0 for percentage strings like "100%". Check the string value/type instead so the 100% case is detected.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
4f3017e to
c79bde9
Compare
Contributor
Author
|
@cubic-dev-ai review this PR |
Contributor
@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete. |
81fbfd4 to
7c9ca63
Compare
7c9ca63 to
6eae380
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.
fixes #1706
Summary by cubic
Switch StatefulSet rollouts to delete pods when maxUnavailable is 100% for faster, predictable full restarts that aren’t blocked by PDBs. Tests are simplified with controller-runtime client interceptors and testify, removing go-test/deep, and adding coverage for the delete path and PDB behavior.
New Features
Bug Fixes
Written for commit 6eae380. Summary will update on new commits.