mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 11:47:36 +08:00
[FIX] do not save kube node status to etcd
This commit is contained in:
parent
104f231d36
commit
45b0015737
@ -133,7 +133,9 @@ func (n *Cluster) worker() {
|
||||
//UpdateNode update node info
|
||||
func (n *Cluster) UpdateNode(node *client.HostNode) {
|
||||
n.nodes[node.ID] = node
|
||||
n.client.Put(option.Config.NodePath+"/"+node.ID, node.String())
|
||||
saveNode := *node
|
||||
saveNode.NodeStatus.KubeNode = nil
|
||||
n.client.Put(option.Config.NodePath+"/"+node.ID, saveNode.String())
|
||||
}
|
||||
|
||||
func (n *Cluster) getNodeFromKV(kv *mvccpb.KeyValue) *client.HostNode {
|
||||
|
@ -168,7 +168,9 @@ func (e *etcdClusterClient) RegistNode(node *HostNode) error {
|
||||
func (e *etcdClusterClient) Update(h *HostNode) error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*3)
|
||||
defer cancel()
|
||||
_, err := e.conf.EtcdCli.Put(ctx, e.conf.NodePath+"/"+h.ID, h.String())
|
||||
saveNode := *h
|
||||
saveNode.NodeStatus.KubeNode = nil
|
||||
_, err := e.conf.EtcdCli.Put(ctx, e.conf.NodePath+"/"+saveNode.ID, h.String())
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -413,7 +413,9 @@ func (n *HostNode) String() string {
|
||||
|
||||
//Update update node info
|
||||
func (n *HostNode) Update() (*client.PutResponse, error) {
|
||||
return store.DefalutClient.Put(conf.Config.NodePath+"/"+n.ID, n.String())
|
||||
savenode := *n
|
||||
savenode.NodeStatus.KubeNode = nil
|
||||
return store.DefalutClient.Put(conf.Config.NodePath+"/"+n.ID, savenode.String())
|
||||
}
|
||||
|
||||
//DeleteNode delete node
|
||||
|
Loading…
Reference in New Issue
Block a user