mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-03-09 22:00:31 +00:00
Improve symlink creation loop
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
d2516cb5d5
commit
126c004ee0
@ -129,6 +129,17 @@ func (m command) run(c *cli.Context, cfg *config) error {
|
||||
m.logger.Debugf("%v is not a symlink", candidate)
|
||||
continue
|
||||
}
|
||||
linkPath, err := changeRoot(cfg.hostRoot, containerRoot, candidate)
|
||||
if err != nil {
|
||||
m.logger.Warnf("Failed to resolve path for link %v relative to %v: %v", candidate, cfg.hostRoot, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if created[linkPath] {
|
||||
m.logger.Debugf("Link %v already created", linkPath)
|
||||
continue
|
||||
}
|
||||
|
||||
target, err := changeRoot(cfg.hostRoot, "/", targets[0])
|
||||
if err != nil {
|
||||
m.logger.Warnf("Failed to resolve path for target %v relative to %v: %v", target, cfg.hostRoot, err)
|
||||
|
Loading…
Reference in New Issue
Block a user