Windows: Fixes subpath symlink evaluation

Paths do not always have Targets, which means that the previously added powershell
command will return an empty string, causing pods with subpath mounts to fail.
This commit is contained in:
Claudiu Belu 2020-07-12 07:07:33 -07:00
parent 43fbe17dc6
commit 15ccf86e7c

View File

@ -55,6 +55,10 @@ func evalPath(path string) (linkedPath string, err error) {
return "", err
}
linkedPath = strings.TrimSpace(string(output))
if linkedPath == "" {
klog.V(4).Infof("Path '%s' has no target. Consiering it as evaluated.", path)
return path, nil
}
if isVolumePrefix(linkedPath) {
return path, err
}