mirror of https://github.com/containers/podman.git
Merge pull request #3787 from giuseppe/rootless-cherry-pick-oci-runtime
rootless: cherry-pick runtime from the system configuration
This commit is contained in:
commit
f18cfa4768
|
@ -274,6 +274,8 @@ type runtimeConfiguredFrom struct {
|
||||||
runtimePath bool
|
runtimePath bool
|
||||||
cniPluginDir bool
|
cniPluginDir bool
|
||||||
noPivotRoot bool
|
noPivotRoot bool
|
||||||
|
runtimeSupportsJSON bool
|
||||||
|
ociRuntime bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func defaultRuntimeConfig() (RuntimeConfig, error) {
|
func defaultRuntimeConfig() (RuntimeConfig, error) {
|
||||||
|
@ -593,6 +595,12 @@ func newRuntimeFromConfig(ctx context.Context, userConfigPath string, options ..
|
||||||
if tmpConfig.NoPivotRoot {
|
if tmpConfig.NoPivotRoot {
|
||||||
runtime.configuredFrom.noPivotRoot = true
|
runtime.configuredFrom.noPivotRoot = true
|
||||||
}
|
}
|
||||||
|
if tmpConfig.RuntimeSupportsJSON != nil {
|
||||||
|
runtime.configuredFrom.runtimeSupportsJSON = true
|
||||||
|
}
|
||||||
|
if tmpConfig.OCIRuntime != "" {
|
||||||
|
runtime.configuredFrom.ociRuntime = true
|
||||||
|
}
|
||||||
|
|
||||||
if _, err := toml.Decode(string(contents), runtime.config); err != nil {
|
if _, err := toml.Decode(string(contents), runtime.config); err != nil {
|
||||||
return nil, errors.Wrapf(err, "error decoding configuration file %s", configPath)
|
return nil, errors.Wrapf(err, "error decoding configuration file %s", configPath)
|
||||||
|
@ -633,6 +641,13 @@ func newRuntimeFromConfig(ctx context.Context, userConfigPath string, options ..
|
||||||
if !runtime.configuredFrom.noPivotRoot {
|
if !runtime.configuredFrom.noPivotRoot {
|
||||||
runtime.config.NoPivotRoot = tmpConfig.NoPivotRoot
|
runtime.config.NoPivotRoot = tmpConfig.NoPivotRoot
|
||||||
}
|
}
|
||||||
|
if !runtime.configuredFrom.runtimeSupportsJSON {
|
||||||
|
runtime.config.RuntimeSupportsJSON = tmpConfig.RuntimeSupportsJSON
|
||||||
|
}
|
||||||
|
if !runtime.configuredFrom.ociRuntime {
|
||||||
|
runtime.config.OCIRuntime = tmpConfig.OCIRuntime
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue