Skip to content

Commit 5a39569

Browse files
committed
Unexport checkpoint command
This patch unexports the `checkpoint` command. Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
1 parent c06074b commit 5a39569

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

cli/command/checkpoint/cmd.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,37 @@ package checkpoint
33
import (
44
"github.com/docker/cli/cli"
55
"github.com/docker/cli/cli/command"
6+
"github.com/docker/cli/internal/commands"
67
"github.com/spf13/cobra"
78
)
89

10+
func init() {
11+
commands.Register(newCheckpointCommand)
12+
}
13+
914
// NewCheckpointCommand returns the `checkpoint` subcommand (only in experimental)
10-
func NewCheckpointCommand(dockerCli command.Cli) *cobra.Command {
15+
//
16+
// Deprecated: Do not import commands directly. They will be removed in a future release.
17+
func NewCheckpointCommand(dockerCLI command.Cli) *cobra.Command {
18+
return newCheckpointCommand(dockerCLI)
19+
}
20+
21+
func newCheckpointCommand(dockerCLI command.Cli) *cobra.Command {
1122
cmd := &cobra.Command{
1223
Use: "checkpoint",
1324
Short: "Manage checkpoints",
1425
Args: cli.NoArgs,
15-
RunE: command.ShowHelp(dockerCli.Err()),
26+
RunE: command.ShowHelp(dockerCLI.Err()),
1627
Annotations: map[string]string{
1728
"experimental": "",
1829
"ostype": "linux",
1930
"version": "1.25",
2031
},
2132
}
2233
cmd.AddCommand(
23-
newCreateCommand(dockerCli),
24-
newListCommand(dockerCli),
25-
newRemoveCommand(dockerCli),
34+
newCreateCommand(dockerCLI),
35+
newListCommand(dockerCLI),
36+
newRemoveCommand(dockerCLI),
2637
)
2738
return cmd
2839
}

cli/command/commands/commands.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
4545
// management commands
4646
builder.NewBakeStubCommand(dockerCli),
4747
builder.NewBuilderCommand(dockerCli),
48+
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
4849
checkpoint.NewCheckpointCommand(dockerCli),
4950
container.NewContainerCommand(dockerCli),
5051
context.NewContextCommand(dockerCli),

0 commit comments

Comments
 (0)