Skip to content

Commit

Permalink
Backport ansible-collections#391 to refactored branch
Browse files Browse the repository at this point in the history
The ports commit d68dec3 to the refactored code.
  • Loading branch information
gravesm committed Jun 6, 2022
1 parent 41f73e4 commit afeda5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/module_utils/k8s/waiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ def daemonset_ready(daemonset: ResourceInstance) -> bool:


def statefulset_ready(statefulset: ResourceInstance) -> bool:
# These may be None
updated_replicas = statefulset.status.updatedReplicas or 0
ready_replicas = statefulset.status.readyReplicas or 0
return bool(
statefulset.status
and statefulset.spec.updateStrategy.type == "RollingUpdate"
and statefulset.status.observedGeneration
== (statefulset.metadata.generation or 0)
and statefulset.status.updateRevision == statefulset.status.currentRevision
and statefulset.status.updatedReplicas == statefulset.spec.replicas
and statefulset.status.readyReplicas == statefulset.spec.replicas
and updated_replicas == statefulset.spec.replicas
and ready_replicas == statefulset.spec.replicas
and statefulset.status.replicas == statefulset.spec.replicas
)

Expand Down

0 comments on commit afeda5c

Please sign in to comment.