Skip to content

Commit 8c0440a

Browse files
authored
Merge pull request #6335 from thaJeztah/rm_exported_cobra_funcs
cli/command/*: remove deprecated cobra command constructors
2 parents 40e605a + 873609d commit 8c0440a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+40
-436
lines changed

cli/command/builder/cmd.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ func init() {
1616
})
1717
}
1818

19-
// NewBuilderCommand returns a cobra command for `builder` subcommands
20-
//
21-
// Deprecated: Do not import commands directly. They will be removed in a future release.
22-
func NewBuilderCommand(dockerCLI command.Cli) *cobra.Command {
23-
return newBuilderCommand(dockerCLI)
24-
}
25-
19+
// newBuilderCommand returns a cobra command for `builder` subcommands
2620
func newBuilderCommand(dockerCLI command.Cli) *cobra.Command {
2721
cmd := &cobra.Command{
2822
Use: "builder",
@@ -40,16 +34,10 @@ func newBuilderCommand(dockerCLI command.Cli) *cobra.Command {
4034
return cmd
4135
}
4236

43-
// NewBakeStubCommand returns a cobra command "stub" for the "bake" subcommand.
37+
// newBakeStubCommand returns a cobra command "stub" for the "bake" subcommand.
4438
// This command is a placeholder / stub that is dynamically replaced by an
4539
// alias for "docker buildx bake" if BuildKit is enabled (and the buildx plugin
4640
// installed).
47-
//
48-
// Deprecated: Do not import commands directly. They will be removed in a future release.
49-
func NewBakeStubCommand(dockerCLI command.Streams) *cobra.Command {
50-
return newBakeStubCommand(dockerCLI)
51-
}
52-
5341
func newBakeStubCommand(dockerCLI command.Streams) *cobra.Command {
5442
return &cobra.Command{
5543
Use: "bake [OPTIONS] [TARGET...]",

cli/command/checkpoint/cmd.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ func init() {
1111
commands.Register(newCheckpointCommand)
1212
}
1313

14-
// NewCheckpointCommand returns the `checkpoint` subcommand (only in experimental)
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-
14+
// newCheckpointCommand returns the `checkpoint` subcommand (only in experimental)
2115
func newCheckpointCommand(dockerCLI command.Cli) *cobra.Command {
2216
cmd := &cobra.Command{
2317
Use: "checkpoint",

cli/command/config/cmd.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@ func init() {
1313
commands.Register(newConfigCommand)
1414
}
1515

16-
// NewConfigCommand returns a cobra command for `config` subcommands
17-
//
18-
// Deprecated: Do not import commands directly. They will be removed in a future release.
19-
func NewConfigCommand(dockerCLI command.Cli) *cobra.Command {
20-
return newConfigCommand(dockerCLI)
21-
}
22-
16+
// newConfigCommand returns a cobra command for `config` subcommands
2317
func newConfigCommand(dockerCLI command.Cli) *cobra.Command {
2418
cmd := &cobra.Command{
2519
Use: "config",

cli/command/container/attach.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,7 @@ func inspectContainerAndCheckState(ctx context.Context, apiClient client.APIClie
4040
return &c, nil
4141
}
4242

43-
// NewAttachCommand creates a new cobra.Command for `docker attach`
44-
//
45-
// Deprecated: Do not import commands directly. They will be removed in a future release.
46-
func NewAttachCommand(dockerCLI command.Cli) *cobra.Command {
47-
return newAttachCommand(dockerCLI)
48-
}
49-
43+
// newAttachCommand creates a new cobra.Command for `docker attach`
5044
func newAttachCommand(dockerCLI command.Cli) *cobra.Command {
5145
var opts AttachOptions
5246

cli/command/container/cmd.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,7 @@ func init() {
3434
commands.RegisterLegacy(newWaitCommand)
3535
}
3636

37-
// NewContainerCommand returns a cobra command for `container` subcommands
38-
//
39-
// Deprecated: Do not import commands directly. They will be removed in a future release.
40-
func NewContainerCommand(dockerCLI command.Cli) *cobra.Command {
41-
return newContainerCommand(dockerCLI)
42-
}
43-
37+
// newContainerCommand returns a cobra command for `container` subcommands
4438
func newContainerCommand(dockerCLI command.Cli) *cobra.Command {
4539
cmd := &cobra.Command{
4640
Use: "container",

cli/command/container/commit.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ type commitOptions struct {
2222
changes opts.ListOpts
2323
}
2424

25-
// NewCommitCommand creates a new cobra.Command for `docker commit`
26-
//
27-
// Deprecated: Do not import commands directly. They will be removed in a future release.
28-
func NewCommitCommand(dockerCLI command.Cli) *cobra.Command {
29-
return newCommitCommand(dockerCLI)
30-
}
31-
25+
// newCommitCommand creates a new cobra.Command for `docker commit`
3226
func newCommitCommand(dockerCLI command.Cli) *cobra.Command {
3327
var options commitOptions
3428

cli/command/container/cp.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,7 @@ func copyProgress(ctx context.Context, dst io.Writer, header string, total *int6
121121
return restore, done
122122
}
123123

124-
// NewCopyCommand creates a new `docker cp` command
125-
//
126-
// Deprecated: Do not import commands directly. They will be removed in a future release.
127-
func NewCopyCommand(dockerCLI command.Cli) *cobra.Command {
128-
return newCopyCommand(dockerCLI)
129-
}
130-
124+
// newCopyCommand creates a new `docker cp` command
131125
func newCopyCommand(dockerCLI command.Cli) *cobra.Command {
132126
var opts copyOptions
133127

cli/command/container/create.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,7 @@ type createOptions struct {
5151
useAPISocket bool
5252
}
5353

54-
// NewCreateCommand creates a new cobra.Command for `docker create`
55-
//
56-
// Deprecated: Do not import commands directly. They will be removed in a future release.
57-
func NewCreateCommand(dockerCLI command.Cli) *cobra.Command {
58-
return newCreateCommand(dockerCLI)
59-
}
60-
54+
// newCreateCommand creates a new cobra.Command for `docker create`
6155
func newCreateCommand(dockerCLI command.Cli) *cobra.Command {
6256
var options createOptions
6357
var copts *containerOptions

cli/command/container/diff.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ import (
1010
"github.com/spf13/cobra"
1111
)
1212

13-
// NewDiffCommand creates a new cobra.Command for `docker diff`
14-
//
15-
// Deprecated: Do not import commands directly. They will be removed in a future release.
16-
func NewDiffCommand(dockerCLI command.Cli) *cobra.Command {
17-
return newDiffCommand(dockerCLI)
18-
}
19-
13+
// newDiffCommand creates a new cobra.Command for `docker diff`
2014
func newDiffCommand(dockerCLI command.Cli) *cobra.Command {
2115
return &cobra.Command{
2216
Use: "diff CONTAINER",

cli/command/container/exec.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@ func NewExecOptions() ExecOptions {
3939
}
4040
}
4141

42-
// NewExecCommand creates a new cobra.Command for `docker exec`
43-
//
44-
// Deprecated: Do not import commands directly. They will be removed in a future release.
45-
func NewExecCommand(dockerCLI command.Cli) *cobra.Command {
46-
return newExecCommand(dockerCLI)
47-
}
48-
42+
// newExecCommand creates a new cobra.Command for "docker exec".
4943
func newExecCommand(dockerCLI command.Cli) *cobra.Command {
5044
options := NewExecOptions()
5145

0 commit comments

Comments
 (0)