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
c0e3efb4
Commit
c0e3efb4
authored
Sep 05, 2016
by
Paul Morie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve style of kubelet node status test
parent
67387632
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
kubelet_node_status_test.go
pkg/kubelet/kubelet_node_status_test.go
+8
-4
No files found.
pkg/kubelet/kubelet_node_status_test.go
View file @
c0e3efb4
...
...
@@ -1016,6 +1016,10 @@ func TestTryRegisterWithApiServer(t *testing.T) {
},
}
notImplemented
:=
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
return
true
,
nil
,
fmt
.
Errorf
(
"no reaction implemented for %s"
,
action
)
}
for
_
,
tc
:=
range
cases
{
testKubelet
:=
newTestKubelet
(
t
,
false
/* controllerAttachDetachEnabled is a don't-care for this test */
)
kubelet
:=
testKubelet
.
kubelet
...
...
@@ -1028,17 +1032,17 @@ func TestTryRegisterWithApiServer(t *testing.T) {
// Return an existing (matching) node on get.
return
true
,
tc
.
existingNode
,
tc
.
getError
})
kubeClient
.
AddReactor
(
"update"
,
"
*
"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
if
action
.
Get
Resource
()
.
Resource
==
"nodes"
&&
action
.
Get
Subresource
()
==
"status"
{
kubeClient
.
AddReactor
(
"update"
,
"
nodes
"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
if
action
.
GetSubresource
()
==
"status"
{
return
true
,
nil
,
tc
.
updateError
}
return
true
,
nil
,
fmt
.
Errorf
(
"no reaction implemented for %s"
,
action
)
return
notImplemented
(
action
)
})
kubeClient
.
AddReactor
(
"delete"
,
"nodes"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
return
true
,
nil
,
tc
.
deleteError
})
kubeClient
.
AddReactor
(
"*"
,
"*"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
return
true
,
nil
,
fmt
.
Errorf
(
"no reaction implemented for %s"
,
action
)
return
notImplemented
(
action
)
})
result
:=
kubelet
.
tryRegisterWithApiServer
(
tc
.
newNode
)
...
...
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