mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Update node status instead of node in kubelet
This commit is contained in:
		@@ -107,7 +107,7 @@ func (kl *Kubelet) tryRegisterWithApiServer(node *api.Node) bool {
 | 
			
		||||
		// annotation.
 | 
			
		||||
		requiresUpdate := kl.reconcileCMADAnnotationWithExistingNode(node, existingNode)
 | 
			
		||||
		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)
 | 
			
		||||
				return false
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -1028,8 +1028,11 @@ func TestTryRegisterWithApiServer(t *testing.T) {
 | 
			
		||||
			// Return an existing (matching) node on get.
 | 
			
		||||
			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) {
 | 
			
		||||
			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) {
 | 
			
		||||
			return true, nil, tc.deleteError
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user