mirror of
https://github.com/containers/podman.git
synced 2025-11-29 01:28:22 +08:00
Tremendous amount of changes in here, but all should amount to the same thing: changing Go import paths from v5 to v6. Also bumped go.mod to github.com/containers/podman/v6 and updated version to v6.0.0-dev. Signed-off-by: Matt Heon <mheon@redhat.com>
32 lines
760 B
Go
32 lines
760 B
Go
package machine
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"io/fs"
|
|
"strconv"
|
|
|
|
"github.com/containers/podman/v6/pkg/machine/define"
|
|
)
|
|
|
|
// CleanupGVProxy reads the --pid-file for gvproxy attempts to stop it
|
|
func CleanupGVProxy(f define.VMFile) error {
|
|
gvPid, err := f.Read()
|
|
if err != nil {
|
|
// The file will also be removed by gvproxy when it exits so
|
|
// we need to account for the race and can just ignore it here.
|
|
if errors.Is(err, fs.ErrNotExist) {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("unable to read gvproxy pid file: %v", err)
|
|
}
|
|
proxyPid, err := strconv.Atoi(string(gvPid))
|
|
if err != nil {
|
|
return fmt.Errorf("unable to convert pid to integer: %v", err)
|
|
}
|
|
if err := waitOnProcess(proxyPid); err != nil {
|
|
return err
|
|
}
|
|
return removeGVProxyPIDFile(f)
|
|
}
|