mirror of https://github.com/docker/docs.git
fix --addr backward compatibility
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
7394be0704
commit
ad6fac53db
|
@ -33,12 +33,12 @@ var (
|
||||||
Usage: "",
|
Usage: "",
|
||||||
}
|
}
|
||||||
flJoinAdvertise = cli.StringFlag{
|
flJoinAdvertise = cli.StringFlag{
|
||||||
Name: "advertise",
|
Name: "advertise, addr",
|
||||||
Usage: "Address of the Docker Engine joining the cluster. Swarm managers MUST be able to reach Docker at this address.",
|
Usage: "Address of the Docker Engine joining the cluster. Swarm managers MUST be able to reach Docker at this address.",
|
||||||
EnvVar: "SWARM_ADVERTISE",
|
EnvVar: "SWARM_ADVERTISE",
|
||||||
}
|
}
|
||||||
flManageAdvertise = cli.StringFlag{
|
flManageAdvertise = cli.StringFlag{
|
||||||
Name: "advertise",
|
Name: "advertise, addr",
|
||||||
Usage: "Address of the Swarm manager joining the cluster. Other swarm managers MUST be able to reach Swarm at this address.",
|
Usage: "Address of the Swarm manager joining the cluster. Other swarm managers MUST be able to reach Swarm at this address.",
|
||||||
EnvVar: "SWARM_ADVERTISE",
|
EnvVar: "SWARM_ADVERTISE",
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,6 @@ func join(c *cli.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
addr := c.String("advertise")
|
addr := c.String("advertise")
|
||||||
// Backward compatibility.
|
|
||||||
if addr == "" {
|
|
||||||
addr = c.String("addr")
|
|
||||||
}
|
|
||||||
if addr == "" {
|
if addr == "" {
|
||||||
log.Fatal("missing mandatory --advertise flag")
|
log.Fatal("missing mandatory --advertise flag")
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,10 +211,6 @@ func manage(c *cli.Context) {
|
||||||
|
|
||||||
if c.Bool("leader-election") {
|
if c.Bool("leader-election") {
|
||||||
addr := c.String("advertise")
|
addr := c.String("advertise")
|
||||||
// Backward compatibility.
|
|
||||||
if addr == "" {
|
|
||||||
addr = c.String("addr")
|
|
||||||
}
|
|
||||||
if addr == "" {
|
if addr == "" {
|
||||||
log.Fatal("--advertise address must be provided when using --leader-election")
|
log.Fatal("--advertise address must be provided when using --leader-election")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue