forked from runatlantis/atlantis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: atlantis import on workspaces (runatlantis#2937)
* atlantis import not works on workspace * extract workspace_step_runner_delegate from plan_step_runner * import step runner requires workspace delegate
- Loading branch information
Showing
26 changed files
with
769 additions
and
547 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
5 changes: 5 additions & 0 deletions
5
server/controllers/events/testfixtures/test-repos/import-workspace/atlantis.yaml
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,5 @@ | ||
version: 3 | ||
projects: | ||
- name: dir1-ops | ||
dir: dir1 | ||
workspace: ops |
17 changes: 17 additions & 0 deletions
17
server/controllers/events/testfixtures/test-repos/import-workspace/dir1/main.tf
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,17 @@ | ||
resource "random_id" "dummy1" { | ||
count = terraform.workspace == "ops" ? 1 : 0 | ||
|
||
keepers = {} | ||
byte_length = 1 | ||
} | ||
|
||
resource "random_id" "dummy2" { | ||
count = terraform.workspace == "ops" ? 1 : 0 | ||
|
||
keepers = {} | ||
byte_length = 1 | ||
} | ||
|
||
output "workspace" { | ||
value = terraform.workspace | ||
} |
20 changes: 20 additions & 0 deletions
20
...ers/events/testfixtures/test-repos/import-workspace/exp-output-import-dir1-ops-dummy1.txt
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,20 @@ | ||
Ran Import for project: `dir1-ops` dir: `dir1` workspace: `ops` | ||
|
||
```diff | ||
random_id.dummy1[0]: Importing from ID "AA"... | ||
random_id.dummy1[0]: Import prepared! | ||
Prepared random_id for import | ||
random_id.dummy1[0]: Refreshing state... [id=AA] | ||
|
||
Import successful! | ||
|
||
The resources that were imported are shown above. These resources are now in | ||
your Terraform state and will henceforth be managed by Terraform. | ||
|
||
|
||
``` | ||
|
||
* :repeat: To **plan** this project again, comment: | ||
* `atlantis plan -p dir1-ops` | ||
|
||
|
20 changes: 20 additions & 0 deletions
20
...ers/events/testfixtures/test-repos/import-workspace/exp-output-import-dir1-ops-dummy2.txt
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,20 @@ | ||
Ran Import for project: `dir1-ops` dir: `dir1` workspace: `ops` | ||
|
||
```diff | ||
random_id.dummy2[0]: Importing from ID "BB"... | ||
random_id.dummy2[0]: Import prepared! | ||
Prepared random_id for import | ||
random_id.dummy2[0]: Refreshing state... [id=BB] | ||
|
||
Import successful! | ||
|
||
The resources that were imported are shown above. These resources are now in | ||
your Terraform state and will henceforth be managed by Terraform. | ||
|
||
|
||
``` | ||
|
||
* :repeat: To **plan** this project again, comment: | ||
* `atlantis plan -p dir1-ops` | ||
|
||
|
3 changes: 3 additions & 0 deletions
3
server/controllers/events/testfixtures/test-repos/import-workspace/exp-output-merge.txt
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,3 @@ | ||
Locks and plans deleted for the projects and workspaces modified in this pull request: | ||
|
||
- dir: `dir1` workspace: `ops` |
22 changes: 22 additions & 0 deletions
22
server/controllers/events/testfixtures/test-repos/import-workspace/exp-output-plan.txt
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,22 @@ | ||
Ran Plan for project: `dir1-ops` dir: `dir1` workspace: `ops` | ||
|
||
```diff | ||
|
||
No changes. Your infrastructure matches the configuration. | ||
|
||
Terraform has compared your real infrastructure against your configuration | ||
and found no differences, so no changes are needed. | ||
|
||
``` | ||
|
||
* :arrow_forward: To **apply** this plan, comment: | ||
* `atlantis apply -p dir1-ops` | ||
* :put_litter_in_its_place: To **delete** this plan click [here](lock-url) | ||
* :repeat: To **plan** this project again, comment: | ||
* `atlantis plan -p dir1-ops` | ||
|
||
--- | ||
* :fast_forward: To **apply** all unapplied plans from this pull request, comment: | ||
* `atlantis apply` | ||
* :put_litter_in_its_place: To delete all plans and locks for the PR, comment: | ||
* `atlantis unlock` |
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
33 changes: 33 additions & 0 deletions
33
server/core/runtime/mocks/matchers/recv_chan_of_models_line.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.