New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDP-248054: Stop copying mongocli config into atlascli #2945
Conversation
_, err = os.Stat(atlasConfigHomePath) // check if the dir is already there | ||
if err != nil { | ||
defaultPermissions := 0700 | ||
if err = os.Mkdir(atlasConfigHomePath, os.FileMode(defaultPermissions)); err != nil { | ||
return | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tried the changes locally with no folder present? I'm wondering if this is still needed when installing on a clean system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, seems fine, here are some of the commands I tried in case I missed something:
- other commands
❯ ./bin/atlas deployments list
NAME TYPE MDB VER STATE
To list both local and cloud Atlas deployments, authenticate to your Atlas account using the "atlas login" command.
❯ ./bin/atlas clusters list
Error: this action requires authentication
To log in using your Atlas username and password, run: atlas auth login
To set credentials using API keys, run: atlas config init
❯ ./bin/atlas login
To verify your account, copy your one-time verification code:
KRMH-FY38
Paste the code in the browser when prompted to activate your Atlas CLI. Your code will expire after 10 minutes.
To continue, go to https://account.mongodb.com/account/connect
- list before deleting / init then list
❯ ./bin/atlas config list
PROFILE NAME
Usage: atlas config delete <name> [flags]
❯ ./bin/atlas config init
You are configuring a profile for atlas.
All values are optional and you can use environment variables (MONGODB_ATLAS_*) instead.
Enter [?] on any option to get help.
? Public API Key:
? Private API Key: [? for help]
? Default Project ID:
? Default Org ID:
? Default Output Format: plaintext
Your profile is now configured.
You can use [atlas config set] to change these settings at a later time.
❯ ./bin/atlas config list
PROFILE NAME
default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you do do mv ~/Library/Application\ Support/atlascli ~/Library/Application\ Support/atlasclibck
before doing login? that's the part I'm curios, if the folder doesn't exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❯ mv ~/Library/Application\ Support/atlascli ~/Library/Application\ Support/atlasclibck
❯ ./bin/atlas login
To verify your account, copy your one-time verification code:
BVMR-QWR3
Paste the code in the browser when prompted to activate your Atlas CLI. Your code will expire after 10 minutes.
To continue, go to https://account.mongodb.com/account/connect
^C%
❯ ./bin/atlas clusters list
Error: this action requires authentication
To log in using your Atlas username and password, run: atlas auth login
To set credentials using API keys, run: atlas config init
❯ git pull
❯ ./bin/atlas config list
PROFILE NAME
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To continue, go to https://account.mongodb.com/account/connect
^C%
can you continue and see if the file is created? the thing to check if we need to pre create the folder or will it be created along the file, since you are deleting the code that created the folder before trying to create the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, worked fine!
❯ ./bin/atlas login
To verify your account, copy your one-time verification code:
Q9K3-J896
Paste the code in the browser when prompted to activate your Atlas CLI. Your code will expire after 10 minutes.
To continue, go to https://account.mongodb.com/account/connect
Successfully logged in as blvaguiar@gmail.com.
Select one default organization and one default project.
? Choose a default project: 623202922f697375cac9414a
You have successfully configured your profile.
You can use [atlas config set] to change your profile settings later.
❯ ./bin/atlas config list
PROFILE NAME
default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for checking this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Proposed changes
CLOUDP-248054
Checklist
make fmt
and formatted my codeFurther comments