Network not deleted after stack is removed
Make sure adapter.removeNetworks executes during task Remove
adapter.removeNetworks was being skipped for cases when
isUnknownContainer(err) was true after adapter.remove was executed
This fix eliminates the nil return case forcing the function
to continue executing unless there is a true error
Fixes
@@ -369,21 +369,18 @@ 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
}
+ }
// 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 nil
}
