From 15ccf86e7c1440571b38072a15a797704648abdc Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Sun, 12 Jul 2020 07:07:33 -0700 Subject: [PATCH] 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. --- pkg/volume/util/subpath/subpath_windows.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/volume/util/subpath/subpath_windows.go b/pkg/volume/util/subpath/subpath_windows.go index 79ffb859ed5..e71f960dd7b 100644 --- a/pkg/volume/util/subpath/subpath_windows.go +++ b/pkg/volume/util/subpath/subpath_windows.go @@ -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 }