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
67387632
Commit
67387632
authored
Sep 02, 2016
by
Paul Morie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update node status instead of node in kubelet
parent
0cdaf102
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
kubelet_node_status.go
pkg/kubelet/kubelet_node_status.go
+1
-1
kubelet_node_status_test.go
pkg/kubelet/kubelet_node_status_test.go
+5
-2
No files found.
pkg/kubelet/kubelet_node_status.go
View file @
67387632
...
@@ -107,7 +107,7 @@ func (kl *Kubelet) tryRegisterWithApiServer(node *api.Node) bool {
...
@@ -107,7 +107,7 @@ func (kl *Kubelet) tryRegisterWithApiServer(node *api.Node) bool {
// annotation.
// annotation.
requiresUpdate
:=
kl
.
reconcileCMADAnnotationWithExistingNode
(
node
,
existingNode
)
requiresUpdate
:=
kl
.
reconcileCMADAnnotationWithExistingNode
(
node
,
existingNode
)
if
requiresUpdate
{
if
requiresUpdate
{
if
_
,
err
:=
kl
.
kubeClient
.
Core
()
.
Nodes
()
.
Update
(
existingNode
);
err
!=
nil
{
if
_
,
err
:=
kl
.
kubeClient
.
Core
()
.
Nodes
()
.
Update
Status
(
existingNode
);
err
!=
nil
{
glog
.
Errorf
(
"Unable to reconcile node %q with API server: error updating node: %v"
,
kl
.
nodeName
,
err
)
glog
.
Errorf
(
"Unable to reconcile node %q with API server: error updating node: %v"
,
kl
.
nodeName
,
err
)
return
false
return
false
}
}
...
...
pkg/kubelet/kubelet_node_status_test.go
View file @
67387632
...
@@ -1028,8 +1028,11 @@ func TestTryRegisterWithApiServer(t *testing.T) {
...
@@ -1028,8 +1028,11 @@ func TestTryRegisterWithApiServer(t *testing.T) {
// Return an existing (matching) node on get.
// Return an existing (matching) node on get.
return
true
,
tc
.
existingNode
,
tc
.
getError
return
true
,
tc
.
existingNode
,
tc
.
getError
})
})
kubeClient
.
AddReactor
(
"update"
,
"nodes"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
kubeClient
.
AddReactor
(
"update"
,
"*"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
return
true
,
nil
,
tc
.
updateError
if
action
.
GetResource
()
.
Resource
==
"nodes"
&&
action
.
GetSubresource
()
==
"status"
{
return
true
,
nil
,
tc
.
updateError
}
return
true
,
nil
,
fmt
.
Errorf
(
"no reaction implemented for %s"
,
action
)
})
})
kubeClient
.
AddReactor
(
"delete"
,
"nodes"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
kubeClient
.
AddReactor
(
"delete"
,
"nodes"
,
func
(
action
core
.
Action
)
(
bool
,
runtime
.
Object
,
error
)
{
return
true
,
nil
,
tc
.
deleteError
return
true
,
nil
,
tc
.
deleteError
...
...
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