used path package instead of path/filepath so that --volumes and
--device parameters to always validate paths as unix paths instead of
OS-dependent path convention
Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
| ... | ... |
@@ -5,7 +5,7 @@ import ( |
| 5 | 5 |
"net" |
| 6 | 6 |
"net/url" |
| 7 | 7 |
"os" |
| 8 |
- "path/filepath" |
|
| 8 |
+ "path" |
|
| 9 | 9 |
"regexp" |
| 10 | 10 |
"strings" |
| 11 | 11 |
|
| ... | ... |
@@ -151,13 +151,13 @@ func ValidatePath(val string) (string, error) {
|
| 151 | 151 |
splited := strings.SplitN(val, ":", 2) |
| 152 | 152 |
if len(splited) == 1 {
|
| 153 | 153 |
containerPath = splited[0] |
| 154 |
- val = filepath.Clean(splited[0]) |
|
| 154 |
+ val = path.Clean(splited[0]) |
|
| 155 | 155 |
} else {
|
| 156 | 156 |
containerPath = splited[1] |
| 157 |
- val = fmt.Sprintf("%s:%s", splited[0], filepath.Clean(splited[1]))
|
|
| 157 |
+ val = fmt.Sprintf("%s:%s", splited[0], path.Clean(splited[1]))
|
|
| 158 | 158 |
} |
| 159 | 159 |
|
| 160 |
- if !filepath.IsAbs(containerPath) {
|
|
| 160 |
+ if !path.IsAbs(containerPath) {
|
|
| 161 | 161 |
return val, fmt.Errorf("%s is not an absolute path", containerPath)
|
| 162 | 162 |
} |
| 163 | 163 |
return val, nil |