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
dca01289
Commit
dca01289
authored
Apr 17, 2018
by
Pengfei Ni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use filepath.Clean() instead of path.Clean()
parent
28f9356a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
downwardapi.go
pkg/volume/downwardapi/downwardapi.go
+2
-1
quobyte_util.go
pkg/volume/quobyte/quobyte_util.go
+3
-2
atomic_writer_test.go
pkg/volume/util/atomic_writer_test.go
+1
-1
No files found.
pkg/volume/downwardapi/downwardapi.go
View file @
dca01289
...
@@ -19,6 +19,7 @@ package downwardapi
...
@@ -19,6 +19,7 @@ package downwardapi
import
(
import
(
"fmt"
"fmt"
"path"
"path"
"path/filepath"
"sort"
"sort"
"strings"
"strings"
...
@@ -229,7 +230,7 @@ func CollectData(items []v1.DownwardAPIVolumeFile, pod *v1.Pod, host volume.Volu
...
@@ -229,7 +230,7 @@ func CollectData(items []v1.DownwardAPIVolumeFile, pod *v1.Pod, host volume.Volu
data
:=
make
(
map
[
string
]
volumeutil
.
FileProjection
)
data
:=
make
(
map
[
string
]
volumeutil
.
FileProjection
)
for
_
,
fileInfo
:=
range
items
{
for
_
,
fileInfo
:=
range
items
{
var
fileProjection
volumeutil
.
FileProjection
var
fileProjection
volumeutil
.
FileProjection
fPath
:=
path
.
Clean
(
fileInfo
.
Path
)
fPath
:=
file
path
.
Clean
(
fileInfo
.
Path
)
if
fileInfo
.
Mode
!=
nil
{
if
fileInfo
.
Mode
!=
nil
{
fileProjection
.
Mode
=
*
fileInfo
.
Mode
fileProjection
.
Mode
=
*
fileInfo
.
Mode
}
else
{
}
else
{
...
...
pkg/volume/quobyte/quobyte_util.go
View file @
dca01289
...
@@ -18,7 +18,8 @@ package quobyte
...
@@ -18,7 +18,8 @@ package quobyte
import
(
import
(
"net"
"net"
"path"
"os"
"path/filepath"
"strings"
"strings"
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
...
@@ -101,7 +102,7 @@ func (mounter *quobyteMounter) pluginDirIsMounted(pluginDir string) (bool, error
...
@@ -101,7 +102,7 @@ func (mounter *quobyteMounter) pluginDirIsMounted(pluginDir string) (bool, error
}
}
func
(
mounter
*
quobyteMounter
)
correctTraillingSlash
(
regStr
string
)
string
{
func
(
mounter
*
quobyteMounter
)
correctTraillingSlash
(
regStr
string
)
string
{
return
path
.
Clean
(
regStr
)
+
"/"
return
filepath
.
Clean
(
regStr
)
+
string
(
os
.
PathSeparator
)
}
}
func
validateRegistry
(
registry
string
)
bool
{
func
validateRegistry
(
registry
string
)
bool
{
...
...
pkg/volume/util/atomic_writer_test.go
View file @
dca01289
...
@@ -804,7 +804,7 @@ func checkVolumeContents(targetDir, tcName string, payload map[string]FileProjec
...
@@ -804,7 +804,7 @@ func checkVolumeContents(targetDir, tcName string, payload map[string]FileProjec
cleanPathPayload
:=
make
(
map
[
string
]
FileProjection
,
len
(
payload
))
cleanPathPayload
:=
make
(
map
[
string
]
FileProjection
,
len
(
payload
))
for
k
,
v
:=
range
payload
{
for
k
,
v
:=
range
payload
{
cleanPathPayload
[
path
.
Clean
(
k
)]
=
v
cleanPathPayload
[
file
path
.
Clean
(
k
)]
=
v
}
}
if
!
reflect
.
DeepEqual
(
cleanPathPayload
,
observedPayload
)
{
if
!
reflect
.
DeepEqual
(
cleanPathPayload
,
observedPayload
)
{
...
...
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