Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2e19f709
Commit
2e19f709
authored
Oct 25, 2018
by
Deep Debroy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve comments for when hostPath in Windows needs to be transformed
Signed-off-by:
Deep Debroy
<
ddebroy@docker.com
>
parent
f8a69f10
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
kubelet_pods.go
pkg/kubelet/kubelet_pods.go
+2
-0
No files found.
pkg/kubelet/kubelet_pods.go
View file @
2e19f709
...
@@ -219,6 +219,8 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h
...
@@ -219,6 +219,8 @@ func makeMounts(pod *v1.Pod, podDir string, container *v1.Container, hostName, h
containerPath
:=
mount
.
MountPath
containerPath
:=
mount
.
MountPath
if
runtime
.
GOOS
==
"windows"
{
if
runtime
.
GOOS
==
"windows"
{
// Append C: only if it looks like a local path. Do not process UNC path/SMB shares/named pipes
// 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
)
{
if
(
strings
.
HasPrefix
(
hostPath
,
"/"
)
||
strings
.
HasPrefix
(
hostPath
,
"
\\
"
))
&&
!
strings
.
Contains
(
hostPath
,
":"
)
&&
!
volumeutil
.
IsWindowsUNCPath
(
runtime
.
GOOS
,
hostPath
)
{
hostPath
=
"c:"
+
hostPath
hostPath
=
"c:"
+
hostPath
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment