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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user