Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions build/ci/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ functions:
CONFIG_PATH=$(./bin/atlas config edit 2>/dev/null)
cat <<EOF > "$CONFIG_PATH"
skip_update_check = true
telemetry_enabled = false
[__e2e]
org_id = '${atlas_org_id}'
Expand All @@ -137,7 +138,6 @@ functions:
private_api_key = '${atlas_private_api_key}'
ops_manager_url = '${mcli_ops_manager_url}'
service = 'cloud'
telemetry_enabled = false
output = 'plaintext'
[__e2e_gov]
Expand All @@ -147,7 +147,6 @@ functions:
private_api_key = '${atlas_gov_private_api_key}'
ops_manager_url = '${mcli_cloud_gov_ops_manager_url}'
service = 'cloudgov'
telemetry_enabled = false
output = 'plaintext'
[__e2e_snapshot]
Expand All @@ -157,7 +156,6 @@ functions:
private_api_key = '12345678-abcd-ef01-2345-6789abcdef01'
ops_manager_url = 'http://localhost:8080/'
service = 'cloud'
telemetry_enabled = false
output = 'plaintext'
EOF
- command: subprocess.exec
Expand Down
13 changes: 7 additions & 6 deletions internal/cli/auth/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ func LogoutBuilder() *cobra.Command {
`,
PreRunE: func(cmd *cobra.Command, _ []string) error {
opts.OutWriter = cmd.OutOrStdout()
opts.config = config.Default()

// If the profile is set in the context, use it instead of the default profile
profile, ok := config.ProfileFromContext(cmd.Context())
if ok {
opts.config = profile
} else {
opts.config = config.Default()
}

// Only initialize OAuth flow if we have OAuth-based auth
Expand All @@ -173,13 +173,14 @@ func LogoutBuilder() *cobra.Command {
var message, entry string
var err error

logoutMessage := "Are you sure you want to log out of profile " + opts.config.Name()
switch opts.config.AuthType() {
case config.APIKeys:
entry = opts.config.PublicAPIKey()
message = "Are you sure you want to log out of account with public API key %s?"
message = logoutMessage + " with public API key %s?"
case config.ServiceAccount:
entry = opts.config.ClientID()
message = "Are you sure you want to log out of service account %s?"
message = logoutMessage + " with service account %s?"
case config.UserAccount:
entry, err = opts.config.AccessTokenSubject()
if err != nil {
Expand All @@ -190,10 +191,10 @@ func LogoutBuilder() *cobra.Command {
return ErrUnauthenticated
}

message = "Are you sure you want to log out of account %s?"
message = logoutMessage + " with user account %s?"
case config.NoAuth, "":
entry = opts.config.Name()
message = "Are you sure you want to clear profile %s?"
message = logoutMessage + " ?"
}

opts.Entry = entry
Expand Down
Loading