mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
![Arnaud Porterie](/assets/img/avatar_default.png)
Use `pkg/discovery` to provide nodes discovery between daemon instances. The functionality is driven by two different command-line flags: the experimental `--cluster-store` (previously `--kv-store`) and `--cluster-advertise`. It can be used in two ways by interested components: 1. Externally by calling the `/info` API and examining the cluster store field. The `pkg/discovery` package can then be used to hit the same endpoint and watch for appearing or disappearing nodes. That is the method that will for example be used by Swarm. 2. Internally by using the `Daemon.discoveryWatcher` instance. That is the method that will for example be used by libnetwork. Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
9 lines
293 B
Go
9 lines
293 B
Go
// +build experimental
|
|
|
|
package daemon
|
|
|
|
import flag "github.com/docker/docker/pkg/mflag"
|
|
|
|
func (config *Config) attachExperimentalFlags(cmd *flag.FlagSet, usageFn func(string) string) {
|
|
cmd.StringVar(&config.DefaultNetwork, []string{"-default-network"}, "", usageFn("Set default network"))
|
|
}
|