Repository navigation
[release-v1.40] fix(status): report a StatefulSet available only once its pods are ready - #5355
Merged
tianfeng92 merged 1 commit intoOct 14, 2026
Conversation
The status manager compared spec.replicas with status.currentReplicas, which counts pods created at the current revision whether or not they are ready. TigeraStatus went Available as soon as a pod existed, seconds before it passed readiness, and the progressing message subtracted the wrong way round, so a rollout reported "awaiting -1 replicas". Check observedGeneration first, then availableReplicas, then updatedReplicas, and count the replicas still awaited as spec minus available. The generation message now names the StatefulSet instead of printing the whole object. Comparing availableReplicas and updatedReplicas with spec only catches a shortfall, so a StatefulSet scaling down from 3 to 1 with all 3 pods still running read as Available. The old spec-versus-currentReplicas check had reported it Progressing. Report it as scaling down while status.replicas is above spec. The check that skips pod diagnosis now reads availableReplicas, the same signal the progressing checks use. (cherry picked from commit 6438fcaf82e8a77340c0e6e1af75d3fefda9c7df in tigera/calico-private)
rene-dekker
approved these changes
Oct 14, 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.
Cherry-pick of tigera/calico-private#14541 (EV-7258), the same change for the operator branch that ships Calico Enterprise v3.22.
What
TigeraStatus no longer reports a StatefulSet Available before its pods are ready, and a rollout no longer says "awaiting -1 replicas".
Why
The status manager compared
spec.replicaswithstatus.currentReplicas, which counts pods that exist whether or not they are ready. On this branch a running pod that is not ready is already reported Degraded bypodsFailing, so the false Available shows while the pod is still Pending. The progressing message subtracted the wrong way round.Fix
Check
observedGeneration, thenavailableReplicas, thenupdatedReplicas, then a scale-down. The awaited count is spec minus available, and the check that skipspodsFailingnow readsavailableReplicas.status.gois identical to master. The test file needed a hand merge.Release Note
See below.
Test plan
go test ./pkg/controller/status/passes, including the new StatefulSet tests.Release note:
AI assistance: Claude Code made the cherry-pick; reviewed by the author.