From 77201e949d2e961a829874283ff6dc66637862e7 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 15 May 2017 14:59:47 +0000 Subject: [PATCH] Don't check if weave is running in protect_against_docker_hang Since it is only called in contexts where we have already checked that. We don't need the detail of whether plugin is enabled; if it's not running then it's ok to remove those socket files. --- weave | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/weave b/weave index 8a6b23c8..162e365f 100755 --- a/weave +++ b/weave @@ -582,17 +582,6 @@ attach() { # functions for interacting with containers ###################################################################### -# Docker Plugin V1 runs in a Docker container. -is_plugin_v1_enabled() { - docker inspect -f '{{.Config.Cmd}}' $CONTAINER_NAME 2>/dev/null | grep -q -- "--plugin" -} - -# The presence of Docker Plugin V2 can be checked only via 'docker plugin', -# as v2 plugins do not run as regular containers. -is_plugin_v2_enabled() { - util_op is-docker-plugin-enabled $PLUGIN_NAME 2>/dev/null -} - # Check that a container for component $1 named $2 with image $3 is not running check_not_running() { RUN_STATUS=$(docker inspect --format='{{.State.Running}} {{.State.Status}} {{.Config.Image}}' $2 2>/dev/null) || true @@ -1313,10 +1302,8 @@ stop() { } protect_against_docker_hang() { - # If the plugin is not running, remove its socket so Docker doesn't try to talk to it - if ! is_plugin_v1_enabled && ! is_plugin_v2_enabled ; then - rm -f $HOST_ROOT/run/docker/plugins/weave.sock $HOST_ROOT/run/docker/plugins/weavemesh.sock - fi + # Since the plugin is not running, remove its socket so Docker doesn't try to talk to it + rm -f $HOST_ROOT/run/docker/plugins/weave.sock $HOST_ROOT/run/docker/plugins/weavemesh.sock } ######################################################################