-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a per-stack PULUMI_HOME directory (#490)
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> ### Proposed changes Closes #483 This PR seeks to isolate the credentials associated with a given `Stack`, to solve the problem of credentials leaking across stacks. Some underlying details here: 1. Pulumi CLI stores login credentials in PULUMI_HOME (e.g. `~/.pulumi/credentials.json`). 2. A side-effect of using `PULUMI_ACCESS_TOKEN` is that the CLI login credentials are set. 4. Pulumi CLI prefers the persisted login credentials to `PULUMI_ACCESS_TOKEN`. This PR takes the conservative approach of encapsulating the PULUMI_HOME into a per-stack working directory, as opposed to reusing `~/.pulumi` across stacks. The working directory is retained across reconciliation passes, and cleaned up during stack finalization. Note that the _workspace_ directory is erased at the end of each reconciliation pass, as is the current behavior. This PR does NOT solve the (lack of) mutability of `PULUMI_ACCESS_TOKEN` across stack updates. _Note that this PR contains some commits (related to hacking on the operator) that will be moved to a separate PR._ ### Technical Details Relevant terminology used within the controller codebase: - **root directory** - a temporary directory for each stack, retained until finalization - **home directory** - the `PULUMI_HOME` directory, located within the stack's root directory - **workspace directory** - the Pulumi workspace directory containing the program and stack configuration. The current behavior of the operator is to erase the workspace directory on each reconciliation pass, e.g. to ensure a clean git checkout. This PR retains this behavior while keeping the home directory across passes, e.g. to reuse the providers. ### Related issues (optional) - pulumi/pulumi#13919
- Loading branch information
1 parent
bd7421a
commit 4d88f98
Showing
7 changed files
with
250 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,3 +88,4 @@ tags | |
### IntelliJ ### | ||
.idea | ||
config/ | ||
.envrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/bin/ | ||
/node_modules/ |
Oops, something went wrong.