Skip to content

Commit

Permalink
Merge pull request #20513 from baude/applehvtiming
Browse files Browse the repository at this point in the history
Small fixes for wacko CI environments
  • Loading branch information
openshift-ci[bot] authored Oct 27, 2023
2 parents 4f6a8f0 + 95a5ad2 commit 0943f3b
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion pkg/machine/applehv/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ func (m *MacMachine) Start(name string, opts machine.StartOptions) error {

// To start the VM, we need to call vfkit

logrus.Debugf("vfkit path is: %s", m.Vfkit.VfkitBinaryPath.Path)
cmd, err := m.Vfkit.VirtualMachine.Cmd(m.Vfkit.VfkitBinaryPath.Path)
if err != nil {
return err
Expand Down Expand Up @@ -910,12 +911,30 @@ func (m *MacMachine) startHostNetworking() (string, machine.APIForwardingState,
return "", 0, err
}

logrus.Debugf("gvproxy binary being used: %s", gvproxyBinary)

cmd, forwardSock, state := m.setupStartHostNetworkingCmd()
c := cmd.Cmd(gvproxyBinary)
if err := c.Start(); err != nil {
return "", 0, fmt.Errorf("unable to execute: %q: %w", cmd.ToCmdline(), err)
}

// We need to wait and make sure gvproxy is in fact running
// before continuing
for i := 0; i < 10; i++ {
_, err := os.Stat(m.GvProxySock.GetPath())
if err == nil {
break
}
logrus.Debugf("gvproxy unixgram socket %q not found: %v", m.GvProxySock.GetPath(), err)
// Sleep for 1/2 second
time.Sleep(500 * time.Millisecond)
}
if err != nil {
// I guess we would also check the pidfile and look to see if it is running
// to?
return "", 0, fmt.Errorf("unable to verify gvproxy is running")
}
return forwardSock, state, nil
}

Expand Down Expand Up @@ -1041,7 +1060,13 @@ func (m *MacMachine) getRuntimeDir() (string, error) {
if !ok {
tmpDir = "/tmp"
}
return filepath.Join(tmpDir, "podman"), nil
rtd := filepath.Join(tmpDir, "podman")
logrus.Debugf("creating runtimeDir: %s", rtd)
if err := os.MkdirAll(rtd, 0755); err != nil {
return "", err
}

return rtd, nil
}

func (m *MacMachine) userGlobalSocketLink() (string, error) {
Expand Down

0 comments on commit 0943f3b

Please sign in to comment.