(dockerCLI command.Cli)
| 12 | } |
| 13 | |
| 14 | func newRemoveCommand(dockerCLI command.Cli) *cobra.Command { |
| 15 | var opts removeOptions |
| 16 | |
| 17 | cmd := &cobra.Command{ |
| 18 | Use: "rm [OPTIONS] CONTAINER CHECKPOINT", |
| 19 | Aliases: []string{"remove"}, |
| 20 | Short: "Remove a checkpoint", |
| 21 | Args: cli.ExactArgs(2), |
| 22 | RunE: func(cmd *cobra.Command, args []string) error { |
| 23 | containerID, checkpointID := args[0], args[1] |
| 24 | _, err := dockerCLI.Client().CheckpointRemove(cmd.Context(), containerID, client.CheckpointRemoveOptions{ |
| 25 | CheckpointID: checkpointID, |
| 26 | CheckpointDir: opts.checkpointDir, |
| 27 | }) |
| 28 | return err |
| 29 | }, |
| 30 | DisableFlagsInUseLine: true, |
| 31 | } |
| 32 | |
| 33 | flags := cmd.Flags() |
| 34 | flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory") |
| 35 | |
| 36 | return cmd |
| 37 | } |
searching dependent graphs…