mirror of
https://github.com/rancher/rke.git
synced 2025-09-26 07:25:09 +00:00
Don't remove Ready nodes during restore
This commit is contained in:
committed by
Alena Prokharchyk
parent
c6a60bfd83
commit
2bf2cd8f5b
@@ -85,6 +85,9 @@ func (c *Cluster) RemoveOldNodes(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
uniqueHosts := hosts.GetUniqueHostList(c.EtcdHosts, c.ControlPlaneHosts, c.WorkerHosts)
|
uniqueHosts := hosts.GetUniqueHostList(c.EtcdHosts, c.ControlPlaneHosts, c.WorkerHosts)
|
||||||
for _, node := range nodeList.Items {
|
for _, node := range nodeList.Items {
|
||||||
|
if k8s.IsNodeReady(node) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
host := &hosts.Host{}
|
host := &hosts.Host{}
|
||||||
host.HostnameOverride = node.Name
|
host.HostnameOverride = node.Name
|
||||||
if !hosts.IsNodeInList(host, uniqueHosts) {
|
if !hosts.IsNodeInList(host, uniqueHosts) {
|
||||||
|
Reference in New Issue
Block a user