Merge branch 'fix-container-root' into 'main'

Fix bug in update-ldcache hook when OCI spec contains a relative root

See merge request nvidia/container-toolkit/container-toolkit!147
This commit is contained in:
Evan Lezar
2022-05-10 22:01:14 +00:00
3 changed files with 26 additions and 16 deletions

View File

@@ -86,14 +86,9 @@ func (m command) run(c *cli.Context, cfg *config) error {
return fmt.Errorf("failed to load container state: %v", err)
}
spec, err := s.LoadSpec()
containerRoot, err := s.GetContainerRoot()
if err != nil {
return fmt.Errorf("failed to load OCI spec: %v", err)
}
var containerRoot string
if spec.Root != nil {
containerRoot = spec.Root.Path
return fmt.Errorf("failed to determined container root: %v", err)
}
csvFiles := cfg.filenames.Value()

View File

@@ -79,14 +79,9 @@ func (m command) run(c *cli.Context, cfg *config) error {
return fmt.Errorf("failed to load container state: %v", err)
}
spec, err := s.LoadSpec()
containerRoot, err := s.GetContainerRoot()
if err != nil {
return fmt.Errorf("failed to load OCI spec: %v", err)
}
var containerRoot string
if spec.Root != nil {
containerRoot = spec.Root.Path
return fmt.Errorf("failed to determined container root: %v", err)
}
err = m.createConfig(containerRoot, cfg.folders.Value())