Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker service update with --detach=false hangs on services wi… #104

Merged
merged 4 commits into from
Jul 6, 2023
Merged
Changes from 2 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
5 changes: 5 additions & 0 deletions shepherd
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ update_services() {
else
logger "Trying to update service $name with image $image" "true"

tasks_num=$(docker service ls | grep "$name" | awk '{print $4}')
AliRezaBeitari marked this conversation as resolved.
Show resolved Hide resolved
if [[ $tasks_num = 0/* ]]; then
detach_option="--detach=true"
fi

# shellcheck disable=SC2086
if ! timeout "${TIMEOUT:-300}" docker "${config_flag[@]}" service update "$name" $detach_option $registry_auth $no_resolve_image_flag ${UPDATE_OPTIONS} --image="$image" > /dev/null; then
logger "Service $name update failed on $hostname!"
Expand Down