mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-28 04:21:03 +00:00
Merge pull request #1957 from bergwolf/network-removal
sandbox: remove network before stopping vm
This commit is contained in:
commit
263f64829d
@ -1473,6 +1473,11 @@ func (s *Sandbox) Stop(force bool) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the network.
|
||||
if err := s.removeNetwork(); err != nil && !force {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := s.stopVM(); err != nil && !force {
|
||||
return err
|
||||
}
|
||||
@ -1481,11 +1486,6 @@ func (s *Sandbox) Stop(force bool) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Remove the network.
|
||||
if err := s.removeNetwork(); err != nil && !force {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := s.storeSandbox(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user