diff options
author | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-12-09 15:20:46 -0800 |
---|---|---|
committer | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-12-09 15:20:56 -0800 |
commit | 88c3694fa50ea8fee314752e096f8070f017ac6c (patch) | |
tree | b0eb9d31fe10efa508b19bf6f7616710f952d9bb /src/k8splugin/internal | |
parent | 0e0605dd850f133b71044e5ae42b9d60a3f8266b (diff) |
Use http when not using tls
Issue-ID: MULTICLOUD-666
Change-Id: I8838fb2d312c841fd421d0a887bcfe181f6281e9
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/internal')
-rw-r--r-- | src/k8splugin/internal/db/etcd.go | 7 |
1 files changed, 6 insertions, 1 deletions
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}, |