don't attempt to delete the mesh network on plugin termination
It's pointless and inconsistent. Firstly, deletion will fail if there are any attached containers. Secondly, we run the plugin with restart=always, so it will get restarted and the network re-created. Removal of the network does still happen on `weave stop|reset`, if possible.
This commit is contained in:
1 parent
a83b58cd27
commit
8061ea4079
1 file changed
+6
-18
+6
-18
@@ -5,9 +5,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/docker/libnetwork/ipamapi"
|
||||
go_docker "github.com/fsouza/go-dockerclient"
|
||||
@@ -90,22 +88,12 @@ func main() {
|
||||
createNetwork(dockerClient, meshNetworkName, meshAddress)
|
||||
}
|
||||
|
||||
sigChan := make(chan os.Signal, 1)
|
||||
signal.Notify(sigChan, os.Interrupt, os.Kill, syscall.SIGTERM)
|
||||
|
||||
select {
|
||||
case sig := <-sigChan:
|
||||
Log.Debugf("Caught signal %s; shutting down", sig)
|
||||
if err := dockerClient.Client.RemoveNetwork(meshNetworkName); err != nil {
|
||||
Log.Fatal(err)
|
||||
}
|
||||
case err := <-endChan:
|
||||
if err != nil {
|
||||
Log.Errorf("Error from listener: %s", err)
|
||||
globalListener.Close()
|
||||
meshListener.Close()
|
||||
os.Exit(1)
|
||||
}
|
||||
err = <-endChan
|
||||
if err != nil {
|
||||
Log.Errorf("Error from listener: %s", err)
|
||||
globalListener.Close()
|
||||
meshListener.Close()
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user