Skip to content

Commit

Permalink
Merge pull request #401 from OrangeBao/release-0.3.0
Browse files Browse the repository at this point in the history
cherry-pick: don't update address of node in node-resources-controller
  • Loading branch information
kosmos-robot authored Feb 1, 2024
2 parents 60e65b6 + aedecad commit f6c789c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ func (c *NodeResourcesController) Reconcile(ctx context.Context, request reconci
// Taints: rootNode.Spec.Taints,
// }
clone.Spec.Taints = rootNode.Spec.Taints
// node-lease-controller will modify the address, do not modify it here as there may be issues.
// relate to https://github.com/kosmos-io/kosmos/pull/338
cloneAddress := clone.Status.Addresses
clone.Status = node.Status
clone.Status.Addresses = cloneAddress
}
}
// TODO ggregation Labels and Annotations for classificationModel
Expand All @@ -166,13 +170,13 @@ func (c *NodeResourcesController) Reconcile(ctx context.Context, request reconci
if _, err = c.RootClientset.CoreV1().Nodes().Patch(ctx, rootNode.Name, types.MergePatchType, patch, metav1.PatchOptions{}); err != nil {
return reconcile.Result{
RequeueAfter: RequeueTime,
}, fmt.Errorf("failed to patch node resources: %v, will requeue", err)
}, fmt.Errorf("(patch) failed to patch node resources: %v, will requeue", err)
}

if _, err = c.RootClientset.CoreV1().Nodes().PatchStatus(ctx, rootNode.Name, patch); err != nil {
return reconcile.Result{
RequeueAfter: RequeueTime,
}, fmt.Errorf("failed to patch node resources: %v, will requeue", err)
}, fmt.Errorf("(patch-status) failed to patch node resources: %v, will requeue", err)
}
}
return reconcile.Result{}, nil
Expand Down

0 comments on commit f6c789c

Please sign in to comment.