Skip to content

Commit

Permalink
Fix depends_on in test (#4397) (#8219)
Browse files Browse the repository at this point in the history
* Fix depends_on in test

* Add test regex fix for node pool

* Add link to bug

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jan 14, 2021
1 parent 5201fe2 commit 0a20c2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .changelog/4397.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
18 changes: 4 additions & 14 deletions google/data_source_google_compute_instance_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,9 @@ resource "google_compute_instance_template" "c" {
}
data "google_compute_instance_template" "default" {
project = "%{project}"
// Hack to prevent depends_on bug triggering datasource recreate due to https://github.com/hashicorp/terraform/issues/11806
project = "%{project}${replace(google_compute_instance_template.a.id, "/.*/", "")}${replace(google_compute_instance_template.b.id, "/.*/", "")}${replace(google_compute_instance_template.c.id, "/.*/", "")}"
filter = "name eq test-template-c-.*"
depends_on = [
google_compute_instance_template.a,
google_compute_instance_template.b,
google_compute_instance_template.c,
]
}
`, map[string]interface{}{"project": project, "suffix": suffix})
}
Expand Down Expand Up @@ -234,15 +229,10 @@ resource "google_compute_instance_template" "c" {
}
data "google_compute_instance_template" "default" {
project = "%{project}"
// Hack to prevent depends_on bug triggering datasource recreate due to https://github.com/hashicorp/terraform/issues/11806
project = "%{project}${replace(google_compute_instance_template.c.id, "/.*/", "")}"
filter = "name eq test-template-.*"
most_recent = true
depends_on = [
google_compute_instance_template.a,
google_compute_instance_template.b,
google_compute_instance_template.c,
]
}
`, map[string]interface{}{"project": project, "suffix": suffix})
}

0 comments on commit 0a20c2c

Please sign in to comment.