@ -2,6 +2,7 @@ package swarm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/docker/cli/cli"
|
||||
"github.com/docker/cli/cli/command"
|
||||
@ -74,16 +75,15 @@ func runUnlockKey(dockerCli command.Cli, opts unlockKeyOptions) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
printUnlockCommand(ctx, dockerCli, unlockKeyResp.UnlockKey)
|
||||
printUnlockCommand(dockerCli.Out(), unlockKeyResp.UnlockKey)
|
||||
return nil
|
||||
}
|
||||
|
||||
func printUnlockCommand(ctx context.Context, dockerCli command.Cli, unlockKey string) {
|
||||
func printUnlockCommand(out io.Writer, unlockKey string) {
|
||||
if len(unlockKey) > 0 {
|
||||
fmt.Fprintf(dockerCli.Out(), "To unlock a swarm manager after it restarts, "+
|
||||
fmt.Fprintf(out, "To unlock a swarm manager after it restarts, "+
|
||||
"run the `docker swarm unlock`\ncommand and provide the following key:\n\n %s\n\n"+
|
||||
"Please remember to store this key in a password manager, since without it you\n"+
|
||||
"will not be able to restart the manager.\n", unlockKey)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user