fix: 'failed to resolve symlink' error messaging
This error message currently does not provide useful information, because the `src` value that is interleaved will have been overridden by the call to `osi.ResolveSymbolicLink`. This stores the original `src` before the `osi.ResolveSymbolicLink` call so the error message can be useful. Signed-off-by: June Rhodes <504826+hach-que@users.noreply.github.com>
This commit is contained in:
parent
e208c24256
commit
3193650f13
@ -67,9 +67,10 @@ func parseMount(osi osinterface.OS, mount *runtime.Mount) (*runtimespec.Mount, e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
|
originalSrc := src
|
||||||
src, err = osi.ResolveSymbolicLink(src)
|
src, err = osi.ResolveSymbolicLink(src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to resolve symlink %q: %w", src, err)
|
return nil, fmt.Errorf("failed to resolve symlink '%q' (resolved to '%q'): %w", originalSrc, src, err)
|
||||||
}
|
}
|
||||||
// hcsshim requires clean path, especially '/' -> '\'. Additionally,
|
// hcsshim requires clean path, especially '/' -> '\'. Additionally,
|
||||||
// for the destination, absolute paths should have the C: prefix.
|
// for the destination, absolute paths should have the C: prefix.
|
||||||
|
Loading…
Reference in New Issue
Block a user