Skip to content

Commit

Permalink
Merge pull request kosmos-io#428 from OrangeBao/release-0.2.0
Browse files Browse the repository at this point in the history
cherry-pick: kosmos node address throw duplicate value error
  • Loading branch information
kosmos-robot authored Mar 5, 2024
2 parents f7cad2a + 1fba238 commit d4bea89
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions pkg/clustertree/cluster-manager/utils/leaf_model_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,10 @@ func (h AggregationModelHandler) UpdateNodeStatus(ctx context.Context, n []*core
return err
}

patch, err := utils.CreateMergePatch(node, clone)
clone.Status.Addresses = updateAddress

if err != nil {
return fmt.Errorf("cannot get node while update node status %s, err: %v", node.Name, err)
}

if latestNode, err := h.RootClientset.CoreV1().Nodes().PatchStatus(ctx, node.Name, patch); err != nil {
if _, err = h.RootClientset.CoreV1().Nodes().UpdateStatus(ctx, clone, metav1.UpdateOptions{}); err != nil {
return err
} else {
latestNode.ResourceVersion = ""
latestNode.Status.Addresses = updateAddress
if _, err = h.RootClientset.CoreV1().Nodes().UpdateStatus(ctx, latestNode, metav1.UpdateOptions{}); err != nil {
return err
}
}
return nil
})
Expand Down

0 comments on commit d4bea89

Please sign in to comment.