diff options
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/image/image.go | 6 | ||||
-rw-r--r-- | libpod/runtime.go | 22 |
2 files changed, 25 insertions, 3 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go index c871eb3e4..739372e77 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -823,9 +823,9 @@ func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error) { return nil, err } - var repoDigests []string - for _, name := range i.Names() { - repoDigests = append(repoDigests, strings.SplitN(name, ":", 2)[0]+"@"+i.Digest().String()) + repoDigests, err := i.RepoDigests() + if err != nil { + return nil, err } driver, err := i.DriverData() diff --git a/libpod/runtime.go b/libpod/runtime.go index c7000d84a..c975f628b 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -385,6 +385,28 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) { if _, err := toml.Decode(string(contents), runtime.config); err != nil { return nil, errors.Wrapf(err, "error decoding configuration file %s", configPath) } + } else if rootless.IsRootless() { + // If the configuration file was not found but we are running in rootless, a subset of the + // global config file is used. + for _, path := range []string{OverrideConfigPath, ConfigPath} { + contents, err := ioutil.ReadFile(OverrideConfigPath) + if err != nil { + // Ignore any error, the file might not be readable by us. + continue + } + tmpConfig := new(RuntimeConfig) + if _, err := toml.Decode(string(contents), tmpConfig); err != nil { + return nil, errors.Wrapf(err, "error decoding configuration file %s", path) + } + + // Cherry pick the settings we want from the global configuration + runtime.config.ConmonPath = tmpConfig.ConmonPath + runtime.config.ConmonEnvVars = tmpConfig.ConmonEnvVars + runtime.config.OCIRuntimes = tmpConfig.OCIRuntimes + runtime.config.CNIPluginDir = tmpConfig.CNIPluginDir + runtime.config.NoPivotRoot = tmpConfig.NoPivotRoot + break + } } // Overwrite config with user-given configuration options |