mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-04-20 22:25:22 +00:00
Use state.GetContainerRoot in nvidia-ctk hook subcommands
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
395f6cecb2
commit
55efdc8765
@ -87,14 +87,9 @@ func (m command) run(c *cli.Context, cfg *config) error {
|
|||||||
return fmt.Errorf("failed to load container state: %v", err)
|
return fmt.Errorf("failed to load container state: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
spec, err := s.LoadSpec()
|
containerRoot, err := s.GetContainerRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to load OCI spec: %v", err)
|
return fmt.Errorf("failed to determined container root: %v", err)
|
||||||
}
|
|
||||||
|
|
||||||
var containerRoot string
|
|
||||||
if spec.Root != nil {
|
|
||||||
containerRoot = spec.Root.Path
|
|
||||||
}
|
}
|
||||||
|
|
||||||
csvFiles := cfg.filenames.Value()
|
csvFiles := cfg.filenames.Value()
|
||||||
|
@ -79,14 +79,9 @@ func (m command) run(c *cli.Context, cfg *config) error {
|
|||||||
return fmt.Errorf("failed to load container state: %v", err)
|
return fmt.Errorf("failed to load container state: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
spec, err := s.LoadSpec()
|
containerRoot, err := s.GetContainerRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to load OCI spec: %v", err)
|
return fmt.Errorf("failed to determined container root: %v", err)
|
||||||
}
|
|
||||||
|
|
||||||
var containerRoot string
|
|
||||||
if spec.Root != nil {
|
|
||||||
containerRoot = spec.Root.Path
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = m.createConfig(containerRoot, cfg.folders.Value())
|
err = m.createConfig(containerRoot, cfg.folders.Value())
|
||||||
|
Loading…
Reference in New Issue
Block a user