1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-01 06:56:29 +00:00

Restore backup to a new etcd plane

This commit is contained in:
moelsayed
2019-03-04 18:59:43 +02:00
committed by Alena Prokharchyk
parent bfbdf33820
commit e3d6fb4db9
8 changed files with 54 additions and 20 deletions

View File

@@ -185,10 +185,11 @@ func removeFromHosts(hostToRemove *hosts.Host, hostList []*hosts.Host) []*hosts.
}
func removeFromRKENodes(nodeToRemove v3.RKEConfigNode, nodeList []v3.RKEConfigNode) []v3.RKEConfigNode {
for i := range nodeList {
if nodeToRemove.Address == nodeList[i].Address {
return append(nodeList[:i], nodeList[i+1:]...)
l := []v3.RKEConfigNode{}
for _, node := range nodeList {
if nodeToRemove.Address != node.Address {
l = append(l, node)
}
}
return nodeList
return l
}