Skip to content

fix: do not count Succeeded Pods as living replicas - #63

Merged
desaintmartin merged 1 commit into
mainfrom
fix/succeeded-pods-not-living-replicas
Oct 6, 2026
Merged

desaintmartin merged 1 commit into
mainfrom
fix/succeeded-pods-not-living-replicas

Conversation

@desaintmartin

@desaintmartin desaintmartin commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

is_deployment_stopped no longer counts a Pod in phase Succeeded (Completed) as a living replica.

Chartreuse no longer depends on wiremind-kubernetes: src/chartreuse/kubernetes_helper.py is a trimmed port of KubernetesDeploymentManager, and it carried the same defect. Upgrading the library would not have reached this code.

Defects

  • Succeeded is a terminal phase, like Failed. A Pod in this phase holds no resource.
  • ("Failed") is a string, not a tuple, so not in was a substring test.

Both are fixed by a module-level TERMINAL_POD_PHASES = ("Failed", "Succeeded").

Evidence

Monitoring over 2026-09-17/09-20 shows Pods owned by a ReplicaSet staying in phase Succeeded for the whole 72-hour window, across about 25 namespaces. On 2026-09-18, cargo-staging-spv1 held its webserver, workers, build and business-metrics Deployments in Succeeded at the same time, during a deployment.

Tests

test_is_deployment_stopped is parametrized over Failed, Succeeded, Running and Pending. The last two guard the membership test.

Release

VERSION and CHANGELOG moved to 7.0.2.


Same fix as wiremind-kubernetes #99, released in 7.7.2.

Tracking: TASKS2-4327

is_deployment_stopped counted a Pod in phase Succeeded as a living replica,
so a Deployment holding one was never seen as stopped and the migration
waited for it.

The terminal-phase test also read ("Failed"), a string, so `not in` was a
substring test instead of a membership test.

Same fix as wiremind-kubernetes 7.7.2, which this helper was ported from.
@desaintmartin
desaintmartin requested a review from arthlr October 5, 2026 16:16
@desaintmartin
desaintmartin merged commit 930a107 into main Oct 6, 2026
7 checks passed
@desaintmartin
desaintmartin deleted the fix/succeeded-pods-not-living-replicas branch October 6, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants