Fix warning in docker CLI when swarm ca --ca-cert, etc. flags are passed,

and add a test.

Signed-off-by: Ying Li <ying.li@docker.com>
(cherry picked from commit 4615c92f66)

Conflicts:
components/cli/cli/command/swarm/ca_test.go
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
This commit is contained in:
Ying Li
2017-07-13 00:25:00 +00:00
committed by Andrew Hsu
parent 482d9bdee0
commit 3d947e7a2d
+1 -1
View File
@@ -61,7 +61,7 @@ func runRotateCA(dockerCli command.Cli, flags *pflag.FlagSet, opts caOptions) er
}
if !opts.rotate {
for _, f := range []string{flagCACert, flagCAKey, flagCACert, flagExternalCA} {
for _, f := range []string{flagCACert, flagCAKey, flagCertExpiry, flagExternalCA} {
if flags.Changed(f) {
return fmt.Errorf("`--%s` flag requires the `--rotate` flag to update the CA", f)
}