-
Notifications
You must be signed in to change notification settings - Fork 273
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
fix: login/logout using the configured domain #4050
Conversation
core/src/commands/login.ts
Outdated
// so we initialize it here. noProject also make sure that the project config is not | ||
// initialized in the garden class, so we need to read it in here to get the cloud | ||
// domain. | ||
const projectConfig: ProjectResource | undefined = await cli!.getProjectConfig(log, garden.projectRoot) |
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.
There was a reason for changing this. The cli
parameter is not populated when running from the dev command. This will need to be fixed differently, with that in mind.
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.
login
and logout
are currently not listed as commands in the garden dev
help. Should we make that possible?
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.
They should be listed imo. I think it's a reasonable thing to do in the console.
core/src/cli/command-line.ts
Outdated
@@ -50,6 +50,7 @@ const directInputKeys = [ | |||
] | |||
|
|||
const hideCommands = ["config analytics-enabled", "tools"] | |||
const overrideHiddenCommands = ["login", "logout"] |
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.
A simpler approach would be to just remove the hidden
flag from the commands :P I don't see any reason not to.
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.
Yeah, this is a bit clunky... I looked into where hidden
is used and found this for the reference docs: https://github.com/garden-io/garden/blob/0.13/core/src/docs/commands.ts#L26.
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.
Oh I meant specifically for the login/logout commands. The flag is not necessary on them, and I'm not even sure why it's there in the first place.
One last comment, otherwise seems good to me. Did you test it in the dev command? |
e6b3cf7
to
788e7a7
Compare
Yes a couple of times :) |
@edvald is this ready to go? |
What this PR does / why we need it:
Ensures that the login/logout commands uses the cloud domain in the project config. Both have the
noProject
flag set which leads to the garden instance not being initialized with a project config. Ensures that this is compatible withgarden dev
and also includes login/logout in the help listing.Which issue(s) this PR fixes:
Fixes #4049
Special notes for your reviewer:
@edvald There was an earlier commit which reverted this behavior because of the dev command, 7f93b90. Could you give some more context on how this relates?