Repository navigation
Conversation
resource.Quantity caches its string form lazily in the unexported .s field. The ancestor CR and the freshly normalized CR can hold the same quantity with and without that cache, and messagediff reported the difference as a spec change. A CR with a memory limit such as 2048Mi was therefore reconciled again and again with nothing to change. Exclude the .s path from the spec diff. Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
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 #1904
Problem
resource.Quantitycaches its string form lazily in the unexported.sfield. The ancestor CR stored in status and the freshly normalized CR can hold the same quantity, one with that cache and one without.MakeActionPlandiffs specs withmessagediff, which also compares unexported fields. It reports the difference as a spec change:HasActionsToDo()then returns true. A CR with a limit such as2048Miis reconciled again and again, even though the StatefulSet comparison finds nothing to update.Change
isExcludedPathSegmentnow skips the.spath segment, the same way it already skipsResourceVersionandTaskID. The quantity's value lives in its other fields (i,d,Format), so a real change is still planned.Testing
TestActionPlanIgnoresQuantityStringCacheinaction_plan_test.gobuilds two CHIs with the same2048Mimemory limit, one with the string cache filled and one without.2048Mito4Gi) still produces a plan.go test ./pkg/apis/clickhouse.altinity.com/v1/passes andgo build ./...succeeds. Locally,pkg/model/chbackupandpkg/model/clickhouse(TestEnforceVerifiedLegacyTLS) fail on macOS on the base commit too, so this change does not cause them.AI disclosure: Written with Claude Code (Claude Opus 5.5)
🤖 Generated with Claude Code