mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-02-16 17:42:20 +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)
|
||||
}
|
||||
|
||||
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()
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user