Exemple #1
0
func makeSubnetManager() *subnet.SubnetManager {
	for {
		sm, err := subnet.NewSubnetManager(opts.etcdEndpoint, opts.etcdPrefix)
		if err == nil {
			return sm
		}

		log.Error("Failed to create SubnetManager: ", err)
		time.Sleep(time.Second)
	}
}
Exemple #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)
	}
}