Commit 67387632 authored by Paul Morie's avatar Paul Morie

Update node status instead of node in kubelet

parent 0cdaf102
...@@ -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().UpdateStatus(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
} }
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment