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
d467b29c
Commit
d467b29c
authored
Jun 08, 2018
by
yue9944882
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove duplicated cleaning up func
parent
a2212186
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
20 deletions
+0
-20
file_linux_test.go
pkg/kubelet/config/file_linux_test.go
+0
-20
No files found.
pkg/kubelet/config/file_linux_test.go
View file @
d467b29c
...
@@ -321,10 +321,6 @@ func watchFileChanged(watchDir bool, symlink bool, t *testing.T) {
...
@@ -321,10 +321,6 @@ func watchFileChanged(watchDir bool, symlink bool, t *testing.T) {
if
watchDir
{
if
watchDir
{
NewSourceFile
(
dirName
,
hostname
,
100
*
time
.
Millisecond
,
ch
)
NewSourceFile
(
dirName
,
hostname
,
100
*
time
.
Millisecond
,
ch
)
defer
func
()
{
// Remove the file
deleteFile
(
dirName
,
fileName
,
ch
,
t
)
}()
}
else
{
}
else
{
NewSourceFile
(
file
,
hostname
,
100
*
time
.
Millisecond
,
ch
)
NewSourceFile
(
file
,
hostname
,
100
*
time
.
Millisecond
,
ch
)
}
}
...
@@ -363,22 +359,6 @@ func watchFileChanged(watchDir bool, symlink bool, t *testing.T) {
...
@@ -363,22 +359,6 @@ func watchFileChanged(watchDir bool, symlink bool, t *testing.T) {
}
}
}
}
func
deleteFile
(
dir
,
file
string
,
ch
chan
interface
{},
t
*
testing
.
T
)
{
path
:=
filepath
.
Join
(
dir
,
file
)
if
_
,
err
:=
os
.
Stat
(
path
);
err
!=
nil
{
// The file might absent if it's renamed, deleted..
return
}
go
func
()
{
err
:=
os
.
Remove
(
path
)
if
err
!=
nil
{
t
.
Errorf
(
"unable to remove test file %s: %s"
,
path
,
err
)
}
}()
expectEmptyUpdate
(
t
,
ch
)
}
func
expectUpdate
(
t
*
testing
.
T
,
ch
chan
interface
{},
testCase
*
testCase
)
{
func
expectUpdate
(
t
*
testing
.
T
,
ch
chan
interface
{},
testCase
*
testCase
)
{
timer
:=
time
.
After
(
5
*
time
.
Second
)
timer
:=
time
.
After
(
5
*
time
.
Second
)
for
{
for
{
...
...
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