コード例 #1
0
ファイル: controller.go プロジェクト: maxim28/docker
func (c *controller) initDiscovery(watcher discovery.Watcher) error {
	if c.cfg == nil {
		return fmt.Errorf("discovery initialization requires a valid configuration")
	}

	c.discovery = hostdiscovery.NewHostDiscovery(watcher)
	return c.discovery.Watch(c.activeCallback, c.hostJoinCallback, c.hostLeaveCallback)
}
コード例 #2
0
ファイル: controller.go プロジェクト: chenchun/libnetwork
func (c *controller) initDiscovery() error {
	if c.cfg == nil {
		return fmt.Errorf("discovery initialization requires a valid configuration")
	}

	hostDiscovery := hostdiscovery.NewHostDiscovery()
	return hostDiscovery.StartDiscovery(&c.cfg.Cluster, c.hostJoinCallback, c.hostLeaveCallback)
}