mirror of
https://github.com/rancher/rke.git
synced 2025-09-24 21:07:32 +00:00
Merge pull request #370 from galal-hussein/add_rem_idempotency
Add/Remove etcd idempotency
This commit is contained in:
@@ -193,9 +193,16 @@ func reconcileEtcd(ctx context.Context, currentCluster, kubeCluster *Cluster, ku
|
||||
return err
|
||||
}
|
||||
|
||||
if err := services.AddEtcdMember(ctx, etcdHost, kubeCluster.EtcdHosts, currentCluster.LocalConnDialerFactory, clientCert, clientkey); err != nil {
|
||||
// Check if the host already part of the cluster -- this will cover cluster with lost quorum
|
||||
isEtcdMember, err := services.IsEtcdMember(ctx, etcdHost, kubeCluster.EtcdHosts, currentCluster.LocalConnDialerFactory, clientCert, clientkey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !isEtcdMember {
|
||||
if err := services.AddEtcdMember(ctx, etcdHost, kubeCluster.EtcdHosts, currentCluster.LocalConnDialerFactory, clientCert, clientkey); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
etcdHost.ToAddEtcdMember = false
|
||||
readyHosts := getReadyEtcdHosts(kubeCluster.EtcdHosts)
|
||||
etcdProcessHostMap := kubeCluster.getEtcdProcessHostMap(readyHosts)
|
||||
|
Reference in New Issue
Block a user