Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions heartbeat/podman-etcd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment might be a bit clearer. Something like

Check whether the etcd pod exists on the same node (including stopped/exited containers)

if [ "$count_matches" -eq 1 ]; then
# etcd pod found
return 0
Expand Down