-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove.go
More file actions
26 lines (22 loc) · 699 Bytes
/
Copy pathremove.go
File metadata and controls
26 lines (22 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package checkpoint
import (
"golang.org/x/net/context"
"github.com/docker/docker/cli"
"github.com/docker/docker/cli/command"
"github.com/spf13/cobra"
)
func newRemoveCommand(dockerCli *command.DockerCli) *cobra.Command {
return &cobra.Command{
Use: "rm CONTAINER CHECKPOINT",
Aliases: []string{"remove"},
Short: "Remove a checkpoint",
Args: cli.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
return runRemove(dockerCli, args[0], args[1])
},
}
}
func runRemove(dockerCli *command.DockerCli, container string, checkpoint string) error {
client := dockerCli.Client()
return client.CheckpointDelete(context.Background(), container, checkpoint)
}