(dockerCLI command.Cli)
| 11 | ) |
| 12 | |
| 13 | func newRollbackCommand(dockerCLI command.Cli) *cobra.Command { |
| 14 | options := newServiceOptions() |
| 15 | |
| 16 | cmd := &cobra.Command{ |
| 17 | Use: "rollback [OPTIONS] SERVICE", |
| 18 | Short: "Revert changes to a service's configuration", |
| 19 | Args: cli.ExactArgs(1), |
| 20 | RunE: func(cmd *cobra.Command, args []string) error { |
| 21 | return runRollback(cmd.Context(), dockerCLI, options, args[0]) |
| 22 | }, |
| 23 | Annotations: map[string]string{"version": "1.31"}, |
| 24 | ValidArgsFunction: completeServiceNames(dockerCLI), |
| 25 | DisableFlagsInUseLine: true, |
| 26 | } |
| 27 | |
| 28 | flags := cmd.Flags() |
| 29 | flags.BoolVarP(&options.quiet, flagQuiet, "q", false, "Suppress progress output") |
| 30 | addDetachFlag(flags, &options.detach) |
| 31 | |
| 32 | return cmd |
| 33 | } |
| 34 | |
| 35 | func runRollback(ctx context.Context, dockerCLI command.Cli, options *serviceOptions, serviceID string) error { |
| 36 | apiClient := dockerCLI.Client() |
searching dependent graphs…