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

Function newRollbackCommand

cli/command/service/rollback.go:13–33  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

11)
12
13func 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
35func runRollback(ctx context.Context, dockerCLI command.Cli, options *serviceOptions, serviceID string) error {
36 apiClient := dockerCLI.Client()

Callers 3

newServiceCommandFunction · 0.85
TestRollbackFunction · 0.85
TestRollbackWithErrorsFunction · 0.85

Calls 4

newServiceOptionsFunction · 0.85
runRollbackFunction · 0.85
completeServiceNamesFunction · 0.85
addDetachFlagFunction · 0.85

Tested by 2

TestRollbackFunction · 0.68
TestRollbackWithErrorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…