File tree Expand file tree Collapse file tree 5 files changed +29
-5
lines changed
Expand file tree Collapse file tree 5 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,11 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
4343 image .NewPushCommand (dockerCli ),
4444 //nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
4545 image .NewImagesCommand (dockerCli ),
46+ //nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
4647 registry .NewLoginCommand (dockerCli ),
48+ //nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
4749 registry .NewLogoutCommand (dockerCli ),
50+ //nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
4851 registry .NewSearchCommand (dockerCli ),
4952 //nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
5053 system .NewVersionCommand (dockerCli ),
Original file line number Diff line number Diff line change @@ -32,7 +32,14 @@ type loginOptions struct {
3232}
3333
3434// NewLoginCommand creates a new `docker login` command
35+ //
36+ // Deprecated: Do not import commands directly. They will be removed in a future release.
3537func NewLoginCommand (dockerCLI command.Cli ) * cobra.Command {
38+ return newLoginCommand (dockerCLI )
39+ }
40+
41+ // newLoginCommand creates a new `docker login` command
42+ func newLoginCommand (dockerCLI command.Cli ) * cobra.Command {
3643 var opts loginOptions
3744
3845 cmd := & cobra.Command {
Original file line number Diff line number Diff line change @@ -584,7 +584,7 @@ func TestLoginValidateFlags(t *testing.T) {
584584 },
585585 } {
586586 t .Run (tc .name , func (t * testing.T ) {
587- cmd := NewLoginCommand (test .NewFakeCli (& fakeClient {}))
587+ cmd := newLoginCommand (test .NewFakeCli (& fakeClient {}))
588588 cmd .SetOut (io .Discard )
589589 cmd .SetErr (io .Discard )
590590 cmd .SetArgs (tc .args )
Original file line number Diff line number Diff line change @@ -13,7 +13,14 @@ import (
1313)
1414
1515// NewLogoutCommand creates a new `docker logout` command
16- func NewLogoutCommand (dockerCli command.Cli ) * cobra.Command {
16+ //
17+ // Deprecated: Do not import commands directly. They will be removed in a future release.
18+ func NewLogoutCommand (dockerCLI command.Cli ) * cobra.Command {
19+ return newLogoutCommand (dockerCLI )
20+ }
21+
22+ // newLogoutCommand creates a new `docker logout` command
23+ func newLogoutCommand (dockerCLI command.Cli ) * cobra.Command {
1724 cmd := & cobra.Command {
1825 Use : "logout [SERVER]" ,
1926 Short : "Log out from a registry" ,
@@ -24,7 +31,7 @@ func NewLogoutCommand(dockerCli command.Cli) *cobra.Command {
2431 if len (args ) > 0 {
2532 serverAddress = args [0 ]
2633 }
27- return runLogout (cmd .Context (), dockerCli , serverAddress )
34+ return runLogout (cmd .Context (), dockerCLI , serverAddress )
2835 },
2936 Annotations : map [string ]string {
3037 "category-top" : "9" ,
Original file line number Diff line number Diff line change @@ -22,7 +22,14 @@ type searchOptions struct {
2222}
2323
2424// NewSearchCommand creates a new `docker search` command
25- func NewSearchCommand (dockerCli command.Cli ) * cobra.Command {
25+ //
26+ // Deprecated: Do not import commands directly. They will be removed in a future release.
27+ func NewSearchCommand (dockerCLI command.Cli ) * cobra.Command {
28+ return newSearchCommand (dockerCLI )
29+ }
30+
31+ // newSearchCommand creates a new `docker search` command
32+ func newSearchCommand (dockerCLI command.Cli ) * cobra.Command {
2633 options := searchOptions {filter : opts .NewFilterOpt ()}
2734
2835 cmd := & cobra.Command {
@@ -31,7 +38,7 @@ func NewSearchCommand(dockerCli command.Cli) *cobra.Command {
3138 Args : cli .ExactArgs (1 ),
3239 RunE : func (cmd * cobra.Command , args []string ) error {
3340 options .term = args [0 ]
34- return runSearch (cmd .Context (), dockerCli , options )
41+ return runSearch (cmd .Context (), dockerCLI , options )
3542 },
3643 Annotations : map [string ]string {
3744 "category-top" : "10" ,
You can’t perform that action at this time.
0 commit comments