Przeglądaj źródła

Merge pull request #232 from thaJeztah/19.03_backport_lb_stale_force_leave

[19.03 backport] Network not deleted after stack is removed
Sebastiaan van Stijn 6 lat temu
rodzic
commit
a62d9b9c21
1 zmienionych plików z 4 dodań i 7 usunięć
  1. 4 7
      daemon/cluster/executor/container/controller.go

+ 4 - 7
daemon/cluster/executor/container/controller.go

@@ -369,20 +369,17 @@ func (r *controller) Shutdown(ctx context.Context) error {
 	}
 
 	if err := r.adapter.shutdown(ctx); err != nil {
-		if isUnknownContainer(err) || isStoppedContainer(err) {
-			return nil
+		if !(isUnknownContainer(err) || isStoppedContainer(err)) {
+			return err
 		}
-
-		return err
 	}
 
 	// Try removing networks referenced in this task in case this
 	// task is the last one referencing it
 	if err := r.adapter.removeNetworks(ctx); err != nil {
-		if isUnknownContainer(err) {
-			return nil
+		if !isUnknownContainer(err) {
+			return err
 		}
-		return err
 	}
 
 	return nil