Repository navigation
[release-v1.42] Compare PVC storage quantities semantically in nodeSetName - #5078
Merged
pasanw merged 1 commit intoJul 21, 2026
Merged
Conversation
A non-canonical storage Quantity in the LogStorage CR (e.g. 1024Gi) is written to the Elasticsearch CR in its canonical form (1Ti), because parsing a non-canonical Quantity discards the requested string representation. reflect.DeepEqual compares the Quantity's unexported cached-string field, so it reported the numerically-equal values as different, and nodeSetName generated a new random NodeSet name on every reconcile. Each rename causes ECK to recreate the Elasticsearch StatefulSet and its PVCs, in an unbounded loop. Compare with apiequality.Semantic.DeepEqual instead, which compares quantities by numeric value. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pasanw
marked this pull request as ready for review
July 21, 2026 22:43
rene-dekker
approved these changes
Jul 21, 2026
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.
Description
Cherry-pick of #5073 to
release-v1.42(Calico Enterprise 3.23.x).Issue
A non-canonical storage Quantity in the LogStorage CR (e.g.
1024Gi) is written into the Elasticsearch CR in its canonical form (1Ti).nodeSetName()compares the rendered PVC template against the live Elasticsearch CR withreflect.DeepEqual, which inspects the Quantity's unexported cached-string field. The two numerically-equal values therefore compare as different on every reconcile, so the operator generates a new random NodeSet name each pass. ECK treats a renamed NodeSet as new topology and recreates the StatefulSet and its PVCs β an unbounded reconcile loop that repeatedly provisions new volumes and prevents Elasticsearch from ever becoming operational.The bug was introduced by #4378 (current-ES-aware NodeSet naming), which first shipped in operator v1.41 / CE 3.23.0, so it is present on this branch.
Fix
Compare the PVC resource requirements with
apiequality.Semantic.DeepEqual, which compares Quantities by numeric value (Cmp) and ignores their string representation. A genuine storage change still forces a rename.Cherry-pick note
The reproduction test on this branch uses
pkg/ptr.ToPtr(...)instead of master'sk8s.io/utils/ptr.To(...), becauserelease-v1.42imports the operator's internalpkg/ptrpackage inlogstorage_test.go. The production change inlogstorage.gois identical to #5073.Note
Backport of #5073 β merge only after #5073 lands on
master.Release Note
For PR reviewers
kind/bug,enterprise.π€ Generated with Claude Code