From c467584f8f8fa15fe34bbbeef5ae01960169972d Mon Sep 17 00:00:00 2001 From: moelsayed Date: Sun, 22 Apr 2018 21:03:36 +0200 Subject: [PATCH] Get certificates for active etcd servers only --- cluster/state.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cluster/state.go b/cluster/state.go index bc8dd70e..2a7dda6a 100644 --- a/cluster/state.go +++ b/cluster/state.go @@ -63,7 +63,11 @@ func (c *Cluster) GetClusterState(ctx context.Context) (*Cluster, error) { if err := currentCluster.InvertIndexHosts(); err != nil { return nil, fmt.Errorf("Failed to classify hosts from fetched cluster: %v", err) } - currentCluster.Certificates, err = getClusterCerts(ctx, c.KubeClient, currentCluster.EtcdHosts) + activeEtcdHosts := currentCluster.EtcdHosts + for _, inactiveHost := range c.InactiveHosts { + activeEtcdHosts = removeFromHosts(inactiveHost, activeEtcdHosts) + } + currentCluster.Certificates, err = getClusterCerts(ctx, c.KubeClient, activeEtcdHosts) currentCluster.DockerDialerFactory = c.DockerDialerFactory currentCluster.LocalConnDialerFactory = c.LocalConnDialerFactory if err != nil {