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 regression - Delete .terraform.lock.hcl if it was created by terr…
…aform init (runatlantis#1701) * Delete .terraform.lock.hcl prior to terraform init if it is not staged * Changes suggeted by reviewer
- Loading branch information
Showing
10 changed files
with
557 additions
and
25 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
20 changes: 20 additions & 0 deletions
20
server/controllers/events/testfixtures/null_provider_lockfile_old_version
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 @@ | ||
# This file is maintained automatically by "terraform init". | ||
# Manual edits may be lost in future updates. | ||
|
||
provider "registry.terraform.io/hashicorp/null" { | ||
version = "3.0.0" | ||
constraints = "3.0.0" | ||
hashes = [ | ||
"h1:ysHGBhBNkIiJLEpthB/IVCLpA1Qoncp3KbCTFGFZTO0=", | ||
"zh:05fb7eab469324c97e9b73a61d2ece6f91de4e9b493e573bfeda0f2077bc3a4c", | ||
"zh:1688aa91885a395c4ae67636d411475d0b831e422e005dcf02eedacaafac3bb4", | ||
"zh:24a0b1292e3a474f57c483a7a4512d797e041bc9c2fbaac42fe12e86a7fb5a3c", | ||
"zh:2fc951bd0d1b9b23427acc93be09b6909d72871e464088171da60fbee4fdde03", | ||
"zh:6db825759425599a326385a68acc6be2d9ba0d7d6ef587191d0cdc6daef9ac63", | ||
"zh:85985763d02618993c32c294072cc6ec51f1692b803cb506fcfedca9d40eaec9", | ||
"zh:a53186599c57058be1509f904da512342cfdc5d808efdaf02dec15f0f3cb039a", | ||
"zh:c2e07b49b6efa676bdc7b00c06333ea1792a983a5720f9e2233db27323d2707c", | ||
"zh:cdc8fe1096103cf5374751e2e8408ec4abd2eb67d5a1c5151fe2c7ecfd525bef", | ||
"zh:dbdef21df0c012b0d08776f3d4f34eb0f2f229adfde07ff252a119e52c0f65b7", | ||
] | ||
} |
48 changes: 48 additions & 0 deletions
48
...r/controllers/events/testfixtures/test-repos/simple-with-lockfile/exp-output-autoplan.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,48 @@ | ||
Ran Plan for dir: `.` workspace: `default` | ||
|
||
<details><summary>Show Output</summary> | ||
|
||
```diff | ||
|
||
Terraform used the selected providers to generate the following execution | ||
plan. Resource actions are indicated with the following symbols: | ||
+ create | ||
|
||
Terraform will perform the following actions: | ||
|
||
# null_resource.simple[0] will be created | ||
+ resource "null_resource" "simple" { | ||
+ id = (known after apply) | ||
} | ||
|
||
# null_resource.simple2 will be created | ||
+ resource "null_resource" "simple2" { | ||
+ id = (known after apply) | ||
} | ||
|
||
# null_resource.simple3 will be created | ||
+ resource "null_resource" "simple3" { | ||
+ id = (known after apply) | ||
} | ||
|
||
Plan: 3 to add, 0 to change, 0 to destroy. | ||
|
||
Changes to Outputs: | ||
+ var = "default" | ||
+ workspace = "default" | ||
|
||
``` | ||
|
||
* :arrow_forward: To **apply** this plan, comment: | ||
* `atlantis apply -d .` | ||
* :put_litter_in_its_place: To **delete** this plan click [here](lock-url) | ||
* :repeat: To **plan** this project again, comment: | ||
* `atlantis plan -d .` | ||
</details> | ||
Plan: 3 to add, 0 to change, 0 to destroy. | ||
|
||
--- | ||
* :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` |
48 changes: 48 additions & 0 deletions
48
server/controllers/events/testfixtures/test-repos/simple-with-lockfile/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,48 @@ | ||
Ran Plan for dir: `.` workspace: `default` | ||
|
||
<details><summary>Show Output</summary> | ||
|
||
```diff | ||
|
||
Terraform used the selected providers to generate the following execution | ||
plan. Resource actions are indicated with the following symbols: | ||
+ create | ||
|
||
Terraform will perform the following actions: | ||
|
||
# null_resource.simple[0] will be created | ||
+ resource "null_resource" "simple" { | ||
+ id = (known after apply) | ||
} | ||
|
||
# null_resource.simple2 will be created | ||
+ resource "null_resource" "simple2" { | ||
+ id = (known after apply) | ||
} | ||
|
||
# null_resource.simple3 will be created | ||
+ resource "null_resource" "simple3" { | ||
+ id = (known after apply) | ||
} | ||
|
||
Plan: 3 to add, 0 to change, 0 to destroy. | ||
|
||
Changes to Outputs: | ||
+ var = "default" | ||
+ workspace = "default" | ||
|
||
``` | ||
|
||
* :arrow_forward: To **apply** this plan, comment: | ||
* `atlantis apply -d .` | ||
* :put_litter_in_its_place: To **delete** this plan click [here](lock-url) | ||
* :repeat: To **plan** this project again, comment: | ||
* `atlantis plan -d .` | ||
</details> | ||
Plan: 3 to add, 0 to change, 0 to destroy. | ||
|
||
--- | ||
* :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` |
18 changes: 18 additions & 0 deletions
18
server/controllers/events/testfixtures/test-repos/simple-with-lockfile/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,18 @@ | ||
resource "null_resource" "simple" { | ||
count = 1 | ||
} | ||
|
||
resource "null_resource" "simple2" {} | ||
resource "null_resource" "simple3" {} | ||
|
||
variable "var" { | ||
default = "default" | ||
} | ||
|
||
output "var" { | ||
value = var.var | ||
} | ||
|
||
output "workspace" { | ||
value = terraform.workspace | ||
} |
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
Oops, something went wrong.