mirror of https://github.com/containers/podman.git
`Remove`: remove network and ready sockets from registry
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
parent
d896431b28
commit
13da82466a
|
@ -353,6 +353,18 @@ func (m *HyperVMachine) removeFilesAndConnections(files []string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *HyperVMachine) removeNetworkAndReadySocketsFromRegistry() {
|
||||||
|
// Remove the HVSOCK for networking
|
||||||
|
if err := m.NetworkHVSock.Remove(); err != nil {
|
||||||
|
logrus.Errorf("unable to remove registry entry for %s: %q", m.NetworkHVSock.KeyName, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the HVSOCK for events
|
||||||
|
if err := m.ReadyHVSock.Remove(); err != nil {
|
||||||
|
logrus.Errorf("unable to remove registry entry for %s: %q", m.ReadyHVSock.KeyName, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (m *HyperVMachine) Remove(_ string, opts machine.RemoveOptions) (string, func() error, error) {
|
func (m *HyperVMachine) Remove(_ string, opts machine.RemoveOptions) (string, func() error, error) {
|
||||||
var (
|
var (
|
||||||
files []string
|
files []string
|
||||||
|
@ -384,16 +396,7 @@ func (m *HyperVMachine) Remove(_ string, opts machine.RemoveOptions) (string, fu
|
||||||
confirmationMessage += "\n"
|
confirmationMessage += "\n"
|
||||||
return confirmationMessage, func() error {
|
return confirmationMessage, func() error {
|
||||||
m.removeFilesAndConnections(files)
|
m.removeFilesAndConnections(files)
|
||||||
|
m.removeNetworkAndReadySocketsFromRegistry()
|
||||||
// Remove the HVSOCK for networking
|
|
||||||
if err := m.NetworkHVSock.Remove(); err != nil {
|
|
||||||
logrus.Errorf("unable to remove registry entry for %s: %q", m.NetworkHVSock.KeyName, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove the HVSOCK for events
|
|
||||||
if err := m.ReadyHVSock.Remove(); err != nil {
|
|
||||||
logrus.Errorf("unable to remove registry entry for %s: %q", m.NetworkHVSock.KeyName, err)
|
|
||||||
}
|
|
||||||
return vm.Remove(diskPath)
|
return vm.Remove(diskPath)
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue