Merge f7280c4cd2 into e3ce0bc457
This commit is contained in:
commit
f6406c6182
|
|
@ -465,6 +465,14 @@ func createContainer(container, image, release, authFile string, showCommandToEn
|
||||||
"--volume", runtimeDirectoryMountArg,
|
"--volume", runtimeDirectoryMountArg,
|
||||||
}...)
|
}...)
|
||||||
|
|
||||||
|
if podman.CheckVersion("3.2.0") {
|
||||||
|
if runtime, _ := podman.GetRuntimeName(); runtime == "crun" {
|
||||||
|
createArgs = append(createArgs, []string{
|
||||||
|
"--group-add", "keep-groups",
|
||||||
|
}...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
createArgs = append(createArgs, avahiSocketMount...)
|
createArgs = append(createArgs, avahiSocketMount...)
|
||||||
createArgs = append(createArgs, kcmSocketMount...)
|
createArgs = append(createArgs, kcmSocketMount...)
|
||||||
createArgs = append(createArgs, mediaMount...)
|
createArgs = append(createArgs, mediaMount...)
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,31 @@ func GetImages(args ...string) ([]Image, error) {
|
||||||
return images, nil
|
return images, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetRuntimeName returns OCI Runtime of Podman in a string
|
||||||
|
func GetRuntimeName() (string, error) {
|
||||||
|
var stdout bytes.Buffer
|
||||||
|
|
||||||
|
logLevelString := LogLevel.String()
|
||||||
|
args := []string{"--log-level", logLevelString, "info", "--format", "json"}
|
||||||
|
|
||||||
|
if err := shell.Run("podman", nil, &stdout, nil, args...); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
var podmanInfo struct {
|
||||||
|
Host struct {
|
||||||
|
OCIRuntime struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
} `json:"ociRuntime"`
|
||||||
|
} `json:"host"`
|
||||||
|
}
|
||||||
|
if err := json.Unmarshal(stdout.Bytes(), &podmanInfo); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return podmanInfo.Host.OCIRuntime.Name, nil
|
||||||
|
}
|
||||||
|
|
||||||
// GetVersion returns version of Podman in a string
|
// GetVersion returns version of Podman in a string
|
||||||
func GetVersion() (string, error) {
|
func GetVersion() (string, error) {
|
||||||
if podmanVersion != "" {
|
if podmanVersion != "" {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue