-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make the path to .pulumi folder configurable with an ENV variable #3300
Conversation
I do think we should do this - but I believe this is technically orthogonal (the PR as is will work without this, and there is no reason the binaries need to be in the same |
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.
This LGTM - but would love @pgavlin eyes on it as well just in case there are other corner cases we might need to cover here.
pkg/workspace/paths.go
Outdated
|
||
// PulumiBookkeepingLocationEnvVar is a path to the folder where '.pulumi' folder is stored. | ||
// The path should not include '.pulumi' itself. It defaults to the user's home dir if not specified. | ||
PulumiBookkeepingLocationEnvVar = "PULUMI_BOOKKEEPING_LOCATION" |
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.
The name "bookkeeping" feels a bit unusual here for a public facing thing. Should it be PULUMI_HOME_DIR
? or PULUMI_HOME
?
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.
Yes, I copied it from an internal var, but I do realize it's ugly.
PULUMI_HOME
would sound like ~/.pulumi
to me, so including .pulumi
. Is there a name to indicate that it's one level above?
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.
I feel like it shouldn't append .pulumi
. If you set PULUMI_HOME
, it would be the full path (e.g. PULUMI_HOME=/workspace/pulumi pulumi up
).
See https://getcomposer.org/doc/03-cli.md#composer-home for an example.
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.
I also think it shouldn't add .plumi, just use PULUMI_HOME value as is
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.
I think this makes sense. I renamed to PULUMI_HOME
and now it's assumed to be the full path, so no .pulumi
is appended. The default is still ~/.pulumi
.
cc also @nesl247 and @geekflyer who had input on scenarios that would need this as part of #2966. |
There is just one spot - |
I reverted this check until we change the installation scripts (if we want to). Another point to discuss: Local login files still default to |
@@ -353,7 +353,7 @@ func getUpgradeCommand() string { | |||
return "$ brew upgrade pulumi" | |||
} | |||
|
|||
if filepath.Dir(exe) != filepath.Join(curUser.HomeDir, ".pulumi", "bin") { | |||
if filepath.Dir(exe) != filepath.Join(curUser.HomeDir, workspace.BookkeepingDir, "bin") { | |||
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.
Why bookkeepingdir here but homedir elsewhere?
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.
We would need to adjust the installation scripts first. This PR assumes the bin
is still in its old place.
What's left to get this merged? |
Introduces
PULUMI_HOME
environment variable which points to a path to the path to.pulumi
folder. Defaults to<user's home dir> + ".pulumi"
if not specified.Fixes #2966. In addition to plugins, it "moves" the credentials file, templates, workspaces.
bin
folder is intact: to move it, we need to adjust all installation scripts to respectPULUMI_HOME
and put executables in the properbin
folder.