Skip to content

Commit 15ccf86

Browse files
committed
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.
1 parent 43fbe17 commit 15ccf86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/volume/util/subpath/subpath_windows.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ func evalPath(path string) (linkedPath string, err error) {
5555
return "", err
5656
}
5757
linkedPath = strings.TrimSpace(string(output))
58+
if linkedPath == "" {
59+
klog.V(4).Infof("Path '%s' has no target. Consiering it as evaluated.", path)
60+
return path, nil
61+
}
5862
if isVolumePrefix(linkedPath) {
5963
return path, err
6064
}

0 commit comments

Comments
 (0)