From 2e19f709221fc33e93d40e374450821119e7953b Mon Sep 17 00:00:00 2001 From: Deep Debroy Date: Thu, 25 Oct 2018 13:58:16 -0700 Subject: [PATCH] Improve comments for when hostPath in Windows needs to be transformed Signed-off-by: Deep Debroy --- pkg/kubelet/kubelet_pods.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/kubelet/kubelet_pods.go b/pkg/kubelet/kubelet_pods.go index 0cda842d893..925da6e98a5 100644 --- a/pkg/kubelet/kubelet_pods.go +++ b/pkg/kubelet/kubelet_pods.go @@ -219,6 +219,8 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h containerPath := mount.MountPath if runtime.GOOS == "windows" { // Append C: only if it looks like a local path. Do not process UNC path/SMB shares/named pipes + // NOTE: strings.HasPrefix(hostPath, "\\") checks for prefix "\" as in "\foo\bar" and not "\\foo\bar" + // IsWindowsUNCPath checks for prefix "\\" as in "\\foo\bar" and not "\foo\bar" if (strings.HasPrefix(hostPath, "/") || strings.HasPrefix(hostPath, "\\")) && !strings.Contains(hostPath, ":") && !volumeutil.IsWindowsUNCPath(runtime.GOOS, hostPath) { hostPath = "c:" + hostPath }