mirror of
https://github.com/docker/docs.git
synced 2026-04-12 06:19:22 +07:00
use docker/docker/pkg/discovery
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/docker/swarm/discovery"
|
||||
"github.com/docker/docker/pkg/discovery"
|
||||
)
|
||||
|
||||
func checkAddrFormat(addr string) bool {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/docker/swarm/discovery"
|
||||
"github.com/docker/docker/pkg/discovery"
|
||||
)
|
||||
|
||||
func list(c *cli.Context) {
|
||||
|
||||
@@ -11,12 +11,12 @@ import (
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/docker/docker/pkg/discovery"
|
||||
kvdiscovery "github.com/docker/docker/pkg/discovery/kv"
|
||||
"github.com/docker/swarm/api"
|
||||
"github.com/docker/swarm/cluster"
|
||||
"github.com/docker/swarm/cluster/mesos"
|
||||
"github.com/docker/swarm/cluster/swarm"
|
||||
"github.com/docker/swarm/discovery"
|
||||
kvdiscovery "github.com/docker/swarm/discovery/kv"
|
||||
"github.com/docker/swarm/leadership"
|
||||
"github.com/docker/swarm/scheduler"
|
||||
"github.com/docker/swarm/scheduler/filter"
|
||||
@@ -98,7 +98,7 @@ func loadTLSConfig(ca, cert, key string, verify bool) (*tls.Config, error) {
|
||||
}
|
||||
|
||||
// Initialize the discovery service.
|
||||
func createDiscovery(uri string, c *cli.Context, discoveryOpt []string) discovery.Discovery {
|
||||
func createDiscovery(uri string, c *cli.Context, discoveryOpt []string) discovery.Backend {
|
||||
hb, err := time.ParseDuration(c.String("heartbeat"))
|
||||
if err != nil {
|
||||
log.Fatalf("invalid --heartbeat: %v", err)
|
||||
@@ -129,7 +129,7 @@ func getDiscoveryOpt(c *cli.Context) map[string]string {
|
||||
return options
|
||||
}
|
||||
|
||||
func setupReplication(c *cli.Context, cluster cluster.Cluster, server *api.Server, discovery discovery.Discovery, addr string, leaderTTL time.Duration, tlsConfig *tls.Config) {
|
||||
func setupReplication(c *cli.Context, cluster cluster.Cluster, server *api.Server, discovery discovery.Backend, addr string, leaderTTL time.Duration, tlsConfig *tls.Config) {
|
||||
kvDiscovery, ok := discovery.(*kvdiscovery.Discovery)
|
||||
if !ok {
|
||||
log.Fatal("Leader election is only supported with consul, etcd and zookeeper discovery.")
|
||||
|
||||
Reference in New Issue
Block a user