MCPcopy Index your code
hub / github.com/docker/cli / newUnlockKeyCommand

Function newUnlockKeyCommand

cli/command/swarm/unlock_key.go:20–43  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

18}
19
20func newUnlockKeyCommand(dockerCLI command.Cli) *cobra.Command {
21 opts := unlockKeyOptions{}
22
23 cmd := &cobra.Command{
24 Use: "unlock-key [OPTIONS]",
25 Short: "Manage the unlock key",
26 Args: cli.NoArgs,
27 RunE: func(cmd *cobra.Command, args []string) error {
28 return runUnlockKey(cmd.Context(), dockerCLI, opts)
29 },
30 Annotations: map[string]string{
31 "version": "1.24",
32 "swarm": "manager",
33 },
34 ValidArgsFunction: cobra.NoFileCompletions,
35 DisableFlagsInUseLine: true,
36 }
37
38 flags := cmd.Flags()
39 flags.BoolVar(&opts.rotate, flagRotate, false, "Rotate unlock key")
40 flags.BoolVarP(&opts.quiet, flagQuiet, "q", false, "Only display token")
41
42 return cmd
43}
44
45func runUnlockKey(ctx context.Context, dockerCLI command.Cli, opts unlockKeyOptions) error {
46 apiClient := dockerCLI.Client()

Callers 3

newSwarmCommandFunction · 0.85
TestSwarmUnlockKeyErrorsFunction · 0.85
TestSwarmUnlockKeyFunction · 0.85

Calls 1

runUnlockKeyFunction · 0.85

Tested by 2

TestSwarmUnlockKeyErrorsFunction · 0.68
TestSwarmUnlockKeyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…