Files
docker-cli/components/engine/api/client/swarm/cmd.go
Aaron Lehmann b141a44de0 Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 2cc5bd33eef038bf5721582e2410ba459bb656e9
Component: engine
2016-07-21 15:23:03 -07:00

32 lines
694 B
Go

package swarm
import (
"fmt"
"github.com/spf13/cobra"
"github.com/docker/docker/api/client"
"github.com/docker/docker/cli"
)
// NewSwarmCommand returns a cobra command for `swarm` subcommands
func NewSwarmCommand(dockerCli *client.DockerCli) *cobra.Command {
cmd := &cobra.Command{
Use: "swarm",
Short: "Manage Docker Swarm",
Args: cli.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
},
}
cmd.AddCommand(
newInitCommand(dockerCli),
newJoinCommand(dockerCli),
newUpdateCommand(dockerCli),
newLeaveCommand(dockerCli),
newInspectCommand(dockerCli),
newJoinTokenCommand(dockerCli),
)
return cmd
}