Closed
Description
ENV vars to set defaults for coder login
are ignored.
Note the email, password, and username provided via ENV vars show up in --help
ii@prerepair:~/sharingio/coder$ coder login -h
Authenticate with Coder deployment
Usage:
coder login <url> [flags]
Flags:
-e, --email string Specifies an email address to authenticate with.
Consumes $CODER_EMAIL (default "hh@ii.coop")
-h, --help help for login
-p, --password string Specifies a password to authenticate with.
Consumes $CODER_PASSWORD (default "ii")
-u, --username string Specifies a username to authenticate with.
Consumes $CODER_USERNAME (default "ii")
If the '-u' option is not provided (and it's currently not defaulting to CODER_USERNAME
, tty detection is enabled and calling coder login without arguments fails.
Ideally setting these ENV vars would allow us to run coder login
and respect the ENV provided defaults. I'm also recommend removing the isTTY
altogether.
https://github.com/coder/coder/blob/main/cli/login.go#L91-L94
if username == "" {
if !isTTY(cmd) {
return xerrors.New("the initial user cannot be created in non-interactive mode. use the API")
}
Metadata
Metadata
Assignees
Labels
No labels