Allow swarm init with --availability=drain
This fix adds a new flag `--availability` to `swarm join`. Related documentation has been updated. An integration test has been added. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Upstream-commit: 0f30c644441b3b4150252af1b41db99d4b6e697a Component: engine
This commit is contained in:
@@ -1619,3 +1619,14 @@ func (s *DockerSwarmSuite) TestSwarmJoinWithDrain(c *check.C) {
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(out, checker.Contains, "Drain")
|
||||
}
|
||||
|
||||
func (s *DockerSwarmSuite) TestSwarmInitWithDrain(c *check.C) {
|
||||
d := s.AddDaemon(c, false, false)
|
||||
|
||||
out, err := d.Cmd("swarm", "init", "--availability", "drain")
|
||||
c.Assert(err, checker.IsNil, check.Commentf("out: %v", out))
|
||||
|
||||
out, err = d.Cmd("node", "ls")
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(out, checker.Contains, "Drain")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user