[19.03 backport] Network not deleted after stack is removed
| ... | ... |
@@ -369,20 +369,17 @@ func (r *controller) Shutdown(ctx context.Context) error {
|
| 369 | 369 |
} |
| 370 | 370 |
|
| 371 | 371 |
if err := r.adapter.shutdown(ctx); err != nil {
|
| 372 |
- if isUnknownContainer(err) || isStoppedContainer(err) {
|
|
| 373 |
- return nil |
|
| 372 |
+ if !(isUnknownContainer(err) || isStoppedContainer(err)) {
|
|
| 373 |
+ return err |
|
| 374 | 374 |
} |
| 375 |
- |
|
| 376 |
- return err |
|
| 377 | 375 |
} |
| 378 | 376 |
|
| 379 | 377 |
// Try removing networks referenced in this task in case this |
| 380 | 378 |
// task is the last one referencing it |
| 381 | 379 |
if err := r.adapter.removeNetworks(ctx); err != nil {
|
| 382 |
- if isUnknownContainer(err) {
|
|
| 383 |
- return nil |
|
| 380 |
+ if !isUnknownContainer(err) {
|
|
| 381 |
+ return err |
|
| 384 | 382 |
} |
| 385 |
- return err |
|
| 386 | 383 |
} |
| 387 | 384 |
|
| 388 | 385 |
return nil |