mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 23:38:24 +00:00
Use getResourcePath instead
Also cleans up tests to not shell out for file creation. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
+3
-3
@@ -189,13 +189,13 @@ func (container *Container) parseVolumeMountConfig() (map[string]*Mount, error)
|
||||
if _, exists := container.Volumes[path]; exists {
|
||||
continue
|
||||
}
|
||||
realpath, err := symlink.FollowSymlinkInScope(filepath.Join(container.basefs, path), container.basefs)
|
||||
realPath, err := container.getResourcePath(path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to evaluate the absolute path of symlink")
|
||||
}
|
||||
if stat, err := os.Stat(realpath); err == nil {
|
||||
if stat, err := os.Stat(realPath); err == nil {
|
||||
if !stat.IsDir() {
|
||||
return nil, fmt.Errorf("file exists at %s, can't create volume there", realpath)
|
||||
return nil, fmt.Errorf("file exists at %s, can't create volume there", realPath)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user