Skip to content

Commit 29f2ce7

Browse files
authored
Merge pull request #6257 from thaJeztah/28.x_backport_remove_deprecated
[28.x backport] cli/command: remove deprecated CopyToFile, ConfigureAuth utilities
2 parents 6007e83 + 5c1cee4 commit 29f2ce7

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

cli/command/registry.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,6 @@ func GetDefaultAuthConfig(cfg *configfile.ConfigFile, checkCredStore bool, serve
9797
return registrytypes.AuthConfig(authconfig), nil
9898
}
9999

100-
// ConfigureAuth handles prompting of user's username and password if needed.
101-
//
102-
// Deprecated: use [PromptUserForCredentials] instead.
103-
func ConfigureAuth(ctx context.Context, cli Cli, flUser, flPassword string, authConfig *registrytypes.AuthConfig, _ bool) error {
104-
defaultUsername := authConfig.Username
105-
serverAddress := authConfig.ServerAddress
106-
107-
newAuthConfig, err := PromptUserForCredentials(ctx, cli, flUser, flPassword, defaultUsername, serverAddress)
108-
if err != nil {
109-
return err
110-
}
111-
112-
authConfig.Username = newAuthConfig.Username
113-
authConfig.Password = newAuthConfig.Password
114-
return nil
115-
}
116-
117100
// PromptUserForCredentials handles the CLI prompt for the user to input
118101
// credentials.
119102
// If argUser is not empty, then the user is only prompted for their password.

cli/command/utils.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,10 @@ import (
1414
"github.com/docker/cli/cli/streams"
1515
"github.com/docker/cli/internal/prompt"
1616
"github.com/docker/docker/api/types/filters"
17-
"github.com/moby/sys/atomicwriter"
1817
"github.com/pkg/errors"
1918
"github.com/spf13/pflag"
2019
)
2120

22-
// CopyToFile writes the content of the reader to the specified file
23-
//
24-
// Deprecated: use [atomicwriter.New].
25-
func CopyToFile(outfile string, r io.Reader) error {
26-
writer, err := atomicwriter.New(outfile, 0o600)
27-
if err != nil {
28-
return err
29-
}
30-
defer writer.Close()
31-
_, err = io.Copy(writer, r)
32-
return err
33-
}
34-
3521
const ErrPromptTerminated = prompt.ErrTerminated
3622

3723
// DisableInputEcho disables input echo on the provided streams.In.

0 commit comments

Comments
 (0)