diff --git a/heartbeat/podman-etcd b/heartbeat/podman-etcd index 242226bb1..853f7d1a6 100755 --- a/heartbeat/podman-etcd +++ b/heartbeat/podman-etcd @@ -737,8 +737,8 @@ archive_data_folder() etcd_pod_container_exists() { local count_matches - # Check whether the etcd pod exists on the same node (header line included) - count_matches=$(crictl pods --label app=etcd -q | xargs -I {} crictl ps --pod {} -o json | jq -r '.containers[].metadata | select ( .name == "etcd" ).name' | wc -l) + # Check whether the etcd pod exists on the same node (including stopped/exited containers) + count_matches=$(crictl pods --label app=etcd -q | xargs -I {} crictl ps -a --pod {} -o json | jq -r '.containers[].metadata | select ( .name == "etcd" ).name' | wc -l) if [ "$count_matches" -eq 1 ]; then # etcd pod found return 0