From ac5527e1ab4ed1efe1061b6589702c2d3a76d187 Mon Sep 17 00:00:00 2001 From: James Conroy Date: Wed, 8 Dec 2021 18:16:46 -0600 Subject: [PATCH] Added Comments for future enhancements --- salt/common/tools/sbin/so-status | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/salt/common/tools/sbin/so-status b/salt/common/tools/sbin/so-status index 7fc5e761a..1b5e1d561 100755 --- a/salt/common/tools/sbin/so-status +++ b/salt/common/tools/sbin/so-status @@ -103,9 +103,13 @@ create_expected_container_list() { } populate_container_lists() { + # TODO: check exit code directly, not with $? systemctl is-active --quiet docker if [[ $? = 0 ]]; then + # TODO: why use curl when you can just run docker ps? + # TODO: why use an indexed array when bash has associtive arrays? + # TODO: why use an array when you can just use a string? mapfile -t docker_raw_list < <(curl -s --unix-socket /var/run/docker.sock http:/v1.40/containers/json?all=1 \ | jq -c '.[] | { Name: .Names[0], State: .State }' \ | tr -d '/{"}')