Files
podman/pkg/machine/update.go
Jake Correnti c728eeb39e Create pkg/machine/ignition package
Moves all of the ignitionfiles out of the `machine` package and into
its own called `ignition`. This required `VMType` to get moved out of
the `machine` package and into the `define` package in order to prevent
a circular dependency.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2024-01-04 08:51:35 -05:00

29 lines
818 B
Go

//go:build amd64 || arm64
package machine
import (
"fmt"
"github.com/containers/podman/v4/pkg/machine/ignition"
"github.com/sirupsen/logrus"
)
func UpdatePodmanDockerSockService(vm VM, name string, uid int, rootful bool) error {
content := ignition.GetPodmanDockerTmpConfig(uid, rootful, false)
command := fmt.Sprintf("'echo %q > %s'", content, ignition.PodmanDockerTmpConfPath)
args := []string{"sudo", "bash", "-c", command}
if err := vm.SSH(name, SSHOptions{Args: args}); err != nil {
logrus.Warnf("Could not not update internal docker sock config")
return err
}
args = []string{"sudo", "systemd-tmpfiles", "--create", "--prefix=/run/docker.sock"}
if err := vm.SSH(name, SSHOptions{Args: args}); err != nil {
logrus.Warnf("Could not create internal docker sock")
return err
}
return nil
}