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
c080b756
Commit
c080b756
authored
Nov 01, 2017
by
chentao1596
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused input param
parent
746464bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
file.go
pkg/kubelet/config/file.go
+2
-2
file_linux_test.go
pkg/kubelet/config/file_linux_test.go
+3
-3
No files found.
pkg/kubelet/config/file.go
View file @
c080b756
...
@@ -48,12 +48,12 @@ func NewSourceFile(path string, nodeName types.NodeName, period time.Duration, u
...
@@ -48,12 +48,12 @@ func NewSourceFile(path string, nodeName types.NodeName, period time.Duration, u
// "golang.org/x/exp/inotify" requires a path without trailing "/"
// "golang.org/x/exp/inotify" requires a path without trailing "/"
path
=
strings
.
TrimRight
(
path
,
string
(
os
.
PathSeparator
))
path
=
strings
.
TrimRight
(
path
,
string
(
os
.
PathSeparator
))
config
:=
newSourceFile
(
path
,
nodeName
,
period
,
updates
)
config
:=
newSourceFile
(
path
,
nodeName
,
updates
)
glog
.
V
(
1
)
.
Infof
(
"Watching path %q"
,
path
)
glog
.
V
(
1
)
.
Infof
(
"Watching path %q"
,
path
)
go
wait
.
Forever
(
config
.
run
,
period
)
go
wait
.
Forever
(
config
.
run
,
period
)
}
}
func
newSourceFile
(
path
string
,
nodeName
types
.
NodeName
,
period
time
.
Duration
,
updates
chan
<-
interface
{})
*
sourceFile
{
func
newSourceFile
(
path
string
,
nodeName
types
.
NodeName
,
updates
chan
<-
interface
{})
*
sourceFile
{
send
:=
func
(
objs
[]
interface
{})
{
send
:=
func
(
objs
[]
interface
{})
{
var
pods
[]
*
v1
.
Pod
var
pods
[]
*
v1
.
Pod
for
_
,
o
:=
range
objs
{
for
_
,
o
:=
range
objs
{
...
...
pkg/kubelet/config/file_linux_test.go
View file @
c080b756
...
@@ -46,7 +46,7 @@ import (
...
@@ -46,7 +46,7 @@ import (
func
TestExtractFromNonExistentFile
(
t
*
testing
.
T
)
{
func
TestExtractFromNonExistentFile
(
t
*
testing
.
T
)
{
ch
:=
make
(
chan
interface
{},
1
)
ch
:=
make
(
chan
interface
{},
1
)
c
:=
newSourceFile
(
"/some/fake/file"
,
"localhost"
,
time
.
Millisecond
,
ch
)
c
:=
newSourceFile
(
"/some/fake/file"
,
"localhost"
,
ch
)
err
:=
c
.
watch
()
err
:=
c
.
watch
()
if
err
==
nil
{
if
err
==
nil
{
t
.
Errorf
(
"Expected error"
)
t
.
Errorf
(
"Expected error"
)
...
@@ -137,7 +137,7 @@ func TestExtractFromBadDataFile(t *testing.T) {
...
@@ -137,7 +137,7 @@ func TestExtractFromBadDataFile(t *testing.T) {
}
}
ch
:=
make
(
chan
interface
{},
1
)
ch
:=
make
(
chan
interface
{},
1
)
c
:=
newSourceFile
(
fileName
,
"localhost"
,
time
.
Millisecond
,
ch
)
c
:=
newSourceFile
(
fileName
,
"localhost"
,
ch
)
err
=
c
.
resetStoreFromPath
()
err
=
c
.
resetStoreFromPath
()
if
err
==
nil
{
if
err
==
nil
{
t
.
Fatalf
(
"expected error, got nil"
)
t
.
Fatalf
(
"expected error, got nil"
)
...
@@ -153,7 +153,7 @@ func TestExtractFromEmptyDir(t *testing.T) {
...
@@ -153,7 +153,7 @@ func TestExtractFromEmptyDir(t *testing.T) {
defer
os
.
RemoveAll
(
dirName
)
defer
os
.
RemoveAll
(
dirName
)
ch
:=
make
(
chan
interface
{},
1
)
ch
:=
make
(
chan
interface
{},
1
)
c
:=
newSourceFile
(
dirName
,
"localhost"
,
time
.
Millisecond
,
ch
)
c
:=
newSourceFile
(
dirName
,
"localhost"
,
ch
)
err
=
c
.
resetStoreFromPath
()
err
=
c
.
resetStoreFromPath
()
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
...
...
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