1
0
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:
Alena Prokharchyk
2018-02-22 09:54:34 -08:00
committed by GitHub
2 changed files with 52 additions and 7 deletions

View File

@@ -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)