chore: standardize on ls subcommand when interacting with the docker binary

The ls command is what is referenced in the --help output for the subcommands, so we should just use that everywhere.
This commit is contained in:
Jose Diaz-Gonzalez
2023-07-01 03:29:00 -04:00
parent 5dc2f20432
commit 4436bb2023
5 changed files with 7 additions and 7 deletions

View File

@@ -37,7 +37,7 @@ trigger-scheduler-docker-local-core-post-deploy() {
local NAME="$APP.$DYNO"
local CURRENT_CONTAINER_ID="$(<"$container")"
# TODO: Ensure these are from the current service
local PREVIOUS_CIDS=$("$DOCKER_BIN" container list --all --quiet --filter name="^.?$NAME\$" | xargs) || true
local PREVIOUS_CIDS=$("$DOCKER_BIN" container ls --all --quiet --filter name="^.?$NAME\$" | xargs) || true
if [[ -n $PREVIOUS_CIDS ]]; then
dokku_log_verbose_quiet "Found previous container(s) ($PREVIOUS_CIDS) named $NAME"
# in case $PREVIOUS_CIDS has more than one entry

View File

@@ -14,7 +14,7 @@ trigger-scheduler-docker-local-scheduler-pre-restore() {
# delete all "old" containers
# shellcheck disable=SC2046
"$DOCKER_BIN" container rm $("$DOCKER_BIN" container list --all --format "{{.Names}}" --filter "label=$DOKKU_CONTAINER_LABEL" --quiet | grep -E '(.+\..+\.[0-9]+\.[0-9]+$)') &>/dev/null || true
"$DOCKER_BIN" container rm $("$DOCKER_BIN" container ls --all --format "{{.Names}}" --filter "label=$DOKKU_CONTAINER_LABEL" --quiet | grep -E '(.+\..+\.[0-9]+\.[0-9]+$)') &>/dev/null || true
}
trigger-scheduler-docker-local-scheduler-pre-restore "$@"