From 88c3694fa50ea8fee314752e096f8070f017ac6c Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Mon, 9 Dec 2019 15:20:46 -0800 Subject: Use http when not using tls Issue-ID: MULTICLOUD-666 Change-Id: I8838fb2d312c841fd421d0a887bcfe181f6281e9 Signed-off-by: Kiran Kamineni --- src/k8splugin/internal/db/etcd.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/k8splugin/internal/db') diff --git a/src/k8splugin/internal/db/etcd.go b/src/k8splugin/internal/db/etcd.go index fda44b2f..97771a07 100644 --- a/src/k8splugin/internal/db/etcd.go +++ b/src/k8splugin/internal/db/etcd.go @@ -71,7 +71,12 @@ func newClient(store *clientv3.Client, c EtcdConfig) (EtcdClient, error) { if len(c.CertFile) == 0 && len(c.KeyFile) == 0 && len(c.CAFile) == 0 { tlsConfig = nil } - endpoint := "https://" + c.Endpoint + ":2379" + endpoint := "" + if tlsConfig == nil { + endpoint = "http://" + c.Endpoint + ":2379" + } else { + endpoint = "https://" + c.Endpoint + ":2379" + } store, err = clientv3.New(clientv3.Config{ Endpoints: []string{endpoint}, -- cgit 1.2.3-korg