Skip to content

Commit 315cfd0

Browse files
committed
login: touch-up error for non-TTY
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent be97096 commit 315cfd0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cli/command/registry/login.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func loginUser(ctx context.Context, dockerCLI command.Cli, opts loginOptions, de
210210
// will hit this if you attempt docker login from mintty where stdin
211211
// is a pipe, not a character based console.
212212
if (opts.user == "" || opts.password == "") && !dockerCLI.In().IsTerminal() {
213-
return "", errors.New("error: cannot perform an interactive login from a non TTY device")
213+
return "", errors.New("error: cannot perform an interactive login from a non-TTY device")
214214
}
215215

216216
// If we're logging into the index server and the user didn't provide a username or password, use the device flow

cli/command/registry/login_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func TestRunLogin(t *testing.T) {
128128
input: loginOptions{
129129
serverAddress: "reg1",
130130
},
131-
expectedErr: "error: cannot perform an interactive login from a non TTY device",
131+
expectedErr: "error: cannot perform an interactive login from a non-TTY device",
132132
},
133133
{
134134
doc: "store valid username and password",
@@ -335,19 +335,19 @@ func TestLoginNonInteractive(t *testing.T) {
335335
doc: "error - w/o user w/o pass ",
336336
username: false,
337337
password: false,
338-
expectedErr: "error: cannot perform an interactive login from a non TTY device",
338+
expectedErr: "error: cannot perform an interactive login from a non-TTY device",
339339
},
340340
{
341341
doc: "error - w/ user w/o pass",
342342
username: true,
343343
password: false,
344-
expectedErr: "error: cannot perform an interactive login from a non TTY device",
344+
expectedErr: "error: cannot perform an interactive login from a non-TTY device",
345345
},
346346
{
347347
doc: "error - w/o user w/ pass",
348348
username: false,
349349
password: true,
350-
expectedErr: "error: cannot perform an interactive login from a non TTY device",
350+
expectedErr: "error: cannot perform an interactive login from a non-TTY device",
351351
},
352352
}
353353

@@ -404,13 +404,13 @@ func TestLoginNonInteractive(t *testing.T) {
404404
doc: "error - w/ user w/o pass",
405405
username: true,
406406
password: false,
407-
expectedErr: "error: cannot perform an interactive login from a non TTY device",
407+
expectedErr: "error: cannot perform an interactive login from a non-TTY device",
408408
},
409409
{
410410
doc: "error - w/o user w/ pass",
411411
username: false,
412412
password: true,
413-
expectedErr: "error: cannot perform an interactive login from a non TTY device",
413+
expectedErr: "error: cannot perform an interactive login from a non-TTY device",
414414
},
415415
}
416416

0 commit comments

Comments
 (0)