mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-06 04:52:37 +00:00
k8s_scale - handle scaling StatefulSets with 'updateStrategy=OnDelete' (#579)
k8s_scale - handle scaling StatefulSets with 'updateStrategy=OnDelete' SUMMARY Likely Fixes #503 Handle scaling StatefulSets with 'updateStrategy=OnDelete' ISSUE TYPE Bugfix Pull Request COMPONENT NAME k8s_scale ADDITIONAL INFORMATION Reviewed-by: Mike Graves <mgraves@redhat.com> Reviewed-by: Bikouo Aubin <None>
This commit is contained in:
@@ -61,6 +61,13 @@ def daemonset_ready(daemonset: ResourceInstance) -> bool:
|
||||
|
||||
|
||||
def statefulset_ready(statefulset: ResourceInstance) -> bool:
|
||||
if statefulset.spec.updateStrategy.type == "OnDelete":
|
||||
return bool(
|
||||
statefulset.status
|
||||
and statefulset.status.observedGeneration
|
||||
== (statefulset.metadata.generation or 0)
|
||||
and statefulset.status.replicas == statefulset.spec.replicas
|
||||
)
|
||||
# These may be None
|
||||
updated_replicas = statefulset.status.updatedReplicas or 0
|
||||
ready_replicas = statefulset.status.readyReplicas or 0
|
||||
|
||||
Reference in New Issue
Block a user