Esempio n. 1
0
func newEtcdSubnetRegistry(endpoint, prefix string) subnetRegistry {
	return &etcdSubnetRegistry{
		cli:      etcd.NewClient([]string{endpoint}),
		endpoint: endpoint,
		prefix:   prefix,
	}
}
Esempio n. 2
0
func makeSubnetManager() *subnet.SubnetManager {
	etcdCli := etcd.NewClient([]string{opts.etcdEndpoint})

	for {
		sm, err := subnet.NewSubnetManager(etcdCli, opts.etcdPrefix)
		if err == nil {
			return sm
		}

		log.Error("Failed to create SubnetManager: ", err)
		time.Sleep(time.Second)
	}
}
Esempio n. 3
0
func (esr *etcdSubnetRegistry) resetClient() {
	esr.mux.Lock()
	defer esr.mux.Unlock()
	esr.cli = etcd.NewClient([]string{esr.endpoint})
}