Skip to content

Commit 7d0091c

Browse files
committed
checkpoint: unexport subcommand
unexport subcommand Signed-off-by: ChengyuZhu6 <[email protected]>
1 parent 1b2458d commit 7d0091c

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

cmd/nerdctl/checkpoint/checkpoint.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ func Command() *cobra.Command {
3333
}
3434

3535
cmd.AddCommand(
36-
CreateCommand(),
37-
checkpointLsCommand(),
38-
checkpointRmCommand(),
36+
createCommand(),
37+
lsCommand(),
38+
rmCommand(),
3939
)
4040

4141
return cmd
4242
}
4343

44-
func checkpointLsCommand() *cobra.Command {
45-
x := ListCommand()
44+
func lsCommand() *cobra.Command {
45+
x := listCommand()
4646
x.Use = "ls"
4747
x.Aliases = []string{"list"}
4848
return x
4949
}
50-
func checkpointRmCommand() *cobra.Command {
51-
x := RemoveCommand()
50+
func rmCommand() *cobra.Command {
51+
x := removeCommand()
5252
x.Use = "rm"
5353
x.Aliases = []string{"remove"}
5454
return x

cmd/nerdctl/checkpoint/checkpoint_create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/containerd/nerdctl/v2/pkg/cmd/checkpoint"
2929
)
3030

31-
func CreateCommand() *cobra.Command {
31+
func createCommand() *cobra.Command {
3232
var cmd = &cobra.Command{
3333
Use: "create [OPTIONS] CONTAINER CHECKPOINT",
3434
Short: "Create a checkpoint from a running container",

cmd/nerdctl/checkpoint/checkpoint_create_linux_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ func TestCheckpointCreate(t *testing.T) {
8383
// The issue is tracked in the moby/moby project as https://github.com/moby/moby/issues/50750.
8484
require.Not(nerdtest.Docker),
8585
)
86+
testCase.NoParallel = true
8687
testCase.SubTests = []*test.Case{
8788
{
8889
Description: "leave-running=true",

cmd/nerdctl/checkpoint/checkpoint_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
"github.com/containerd/nerdctl/v2/pkg/cmd/checkpoint"
3030
)
3131

32-
func ListCommand() *cobra.Command {
32+
func listCommand() *cobra.Command {
3333
var cmd = &cobra.Command{
3434
Use: "list [OPTIONS] CONTAINER",
3535
Short: "List checkpoints for a container",

cmd/nerdctl/checkpoint/checkpoint_list_linux_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,14 @@ func TestCheckpointList(t *testing.T) {
8080
// The issue is tracked in the moby/moby project as https://github.com/moby/moby/issues/50750.
8181
require.Not(nerdtest.Docker),
8282
)
83-
83+
testCase.NoParallel = true
8484
testCase.Setup = func(data test.Data, helpers test.Helpers) {
8585
helpers.Ensure("run", "-d", "--name", data.Identifier(), testutil.CommonImage, "sleep", "infinity")
8686
helpers.Ensure("checkpoint", "create", data.Identifier(), checkpointName)
8787
}
8888

8989
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
9090
helpers.Anyhow("rm", "-f", data.Identifier())
91-
helpers.Anyhow("rmi", "-f", testutil.CommonImage)
9291
}
9392

9493
testCase.Command = func(data test.Data, helpers test.Helpers) test.TestableCommand {

cmd/nerdctl/checkpoint/checkpoint_remove.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/containerd/nerdctl/v2/pkg/cmd/checkpoint"
2929
)
3030

31-
func RemoveCommand() *cobra.Command {
31+
func removeCommand() *cobra.Command {
3232
var cmd = &cobra.Command{
3333
Use: "rm [OPTIONS] CONTAINER CHECKPOINT",
3434
Short: "Remove a checkpoint",

cmd/nerdctl/checkpoint/checkpoint_remove_linux_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ func TestCheckpointRemove(t *testing.T) {
8383
// The issue is tracked in the moby/moby project as https://github.com/moby/moby/issues/50750.
8484
require.Not(nerdtest.Docker),
8585
)
86+
testCase.NoParallel = true
8687
testCase.SubTests = []*test.Case{
8788
{
8889
Description: "remove-existing",
@@ -92,7 +93,6 @@ func TestCheckpointRemove(t *testing.T) {
9293
},
9394
Cleanup: func(data test.Data, helpers test.Helpers) {
9495
helpers.Anyhow("rm", "-f", data.Identifier("container-running-remove"))
95-
helpers.Anyhow("rmi", "-f", testutil.CommonImage)
9696
},
9797
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
9898
return helpers.Command("checkpoint", "rm", "--checkpoint-dir", checkpointDir, data.Identifier("container-running-remove"), checkpointName)
@@ -111,7 +111,6 @@ func TestCheckpointRemove(t *testing.T) {
111111
},
112112
Cleanup: func(data test.Data, helpers test.Helpers) {
113113
helpers.Anyhow("rm", "-f", data.Identifier("container-clean-remove"))
114-
helpers.Anyhow("rmi", "-f", testutil.CommonImage)
115114
},
116115
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
117116
return helpers.Command("checkpoint", "rm", "--checkpoint-dir", checkpointDir, data.Identifier("container-clean-remove"), checkpointName)

0 commit comments

Comments
 (0)