(dockerCLI command.Cli)
| 14 | ) |
| 15 | |
| 16 | func newUpdateCommand(dockerCLI command.Cli) *cobra.Command { |
| 17 | var availability string |
| 18 | |
| 19 | cmd := &cobra.Command{ |
| 20 | Use: "update [OPTIONS] [VOLUME]", |
| 21 | Short: "Update a volume (cluster volumes only)", |
| 22 | Args: cli.ExactArgs(1), |
| 23 | RunE: func(cmd *cobra.Command, args []string) error { |
| 24 | return runUpdate(cmd.Context(), dockerCLI, args[0], availability, cmd.Flags()) |
| 25 | }, |
| 26 | Annotations: map[string]string{ |
| 27 | "version": "1.42", |
| 28 | "swarm": "manager", |
| 29 | }, |
| 30 | ValidArgsFunction: completion.VolumeNames(dockerCLI), |
| 31 | DisableFlagsInUseLine: true, |
| 32 | } |
| 33 | |
| 34 | flags := cmd.Flags() |
| 35 | flags.StringVar(&availability, "availability", "active", `Cluster Volume availability ("active", "pause", "drain")`) |
| 36 | _ = flags.SetAnnotation("availability", "version", []string{"1.42"}) |
| 37 | _ = flags.SetAnnotation("availability", "swarm", []string{"manager"}) |
| 38 | |
| 39 | return cmd |
| 40 | } |
| 41 | |
| 42 | func runUpdate(ctx context.Context, dockerCli command.Cli, volumeID, availability string, flags *pflag.FlagSet) error { |
| 43 | // TODO(dperny): For this earliest version, the only thing that can be |
searching dependent graphs…