Skip to content

Commit 3970cfc

Browse files
committed
Updating google provider version
1 parent 0a5caf0 commit 3970cfc

File tree

12 files changed

+801
-171
lines changed

12 files changed

+801
-171
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ docker_test_integration:
6262
-e SERVICE_ACCOUNT_JSON \
6363
-v "$(CURDIR)":/workspace \
6464
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
65-
/usr/local/bin/test_integration.sh
65+
cft test run all
6666

6767
# Execute lint tests within the docker container
6868
.PHONY: docker_test_lint

examples/gcs_event_arc_trigger_workflow/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module "service_account" {
6969
prefix = "gcs-eventarc-workflow"
7070
names = ["simple"]
7171
project_roles = ["${var.project_id}=>roles/workflows.invoker",
72+
"${var.project_id}=>roles/eventarc.serviceAgent",
7273
"${var.project_id}=>roles/eventarc.eventReceiver"]
7374
}
7475

examples/simple_workflow/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
| Name | Description |
1111
|------|-------------|
12-
| project\_id | Google Cloud project in which the workflow is deployed |
1312
| revision\_id | The revision\_id of the workflow. |
1413
| workflow\_id | The id of the workflow. |
1514

examples/simple_workflow/outputs.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,3 @@ output "revision_id" {
2323
description = "The revision_id of the workflow."
2424
value = module.standalone_workflow.revision_id
2525
}
26-
27-
output "project_id" {
28-
description = "Google Cloud project in which the workflow is deployed"
29-
value = var.project_id
30-
}

modules/simple_workflow/metadata.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
repo: https://github.com/GoogleCloudPlatform/terraform-google-cloud-workflows.git
2626
sourceType: git
2727
dir: /modules/simple_workflow
28-
version: 0.1.0
28+
version: 0.1.3
2929
actuationTool:
3030
flavor: Terraform
3131
version: ">= 1.3"
@@ -89,6 +89,7 @@ spec:
8989
roles:
9090
- level: Project
9191
roles:
92+
- roles/workflows.admin
9293
- roles/workflows.invoker
9394
services:
9495
- iam.googleapis.com
@@ -100,4 +101,4 @@ spec:
100101
- storage.googleapis.com
101102
providerVersions:
102103
- source: hashicorp/google
103-
version: ">= 3.53, < 5.0"
104+
version: ">= 3.53, < 7"

modules/simple_workflow/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ terraform {
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"
22-
version = ">= 3.53, < 5.0"
22+
version = ">= 3.53, < 7"
2323
}
2424
}
2525

2626
provider_meta "google" {
27-
module_name = "blueprints/terraform/terraform-google-cloud-workflow:simple-workflow/v0.1.0"
27+
module_name = "blueprints/terraform/terraform-google-cloud-workflow:simple-workflow/v0.1.3"
2828
}
2929
}

test/integration/gcs_event_arc_trigger_workflow/gcs_event_arc_trigger_workflow_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,22 @@ func uploadToGCS(bucket, file string) {
4747
check(err)
4848
}
4949

50+
// Retry if these errors are encountered.
51+
var retryErrors = map[string]string{
52+
".*Provider produced inconsistent final plan.*": "Provider bug, retry",
53+
}
54+
55+
5056
func TestGcsEventArcTriggerWorkflow(t *testing.T) {
51-
bpt := tft.NewTFBlueprintTest(t)
57+
bpt := tft.NewTFBlueprintTest(t, tft.WithRetryableTerraformErrors(retryErrors, 5, time.Minute))
5258

5359
bpt.DefineVerify(func(assert *assert.Assertions) {
5460
waitSeconds := 5
5561
bpt.DefaultVerify(assert)
5662

63+
fmt.Println("Sleeping for ", waitSeconds, " seconds")
64+
time.Sleep(5 * time.Second)
65+
5766
projectId := bpt.GetStringOutput("project_id")
5867
workflowId := bpt.GetStringOutput("workflow_id")
5968
workflowRegion := bpt.GetStringOutput("workflow_region")

test/integration/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module github.com/terraform-google-modules/workspace/test/integration
33
go 1.16
44

55
require (
6-
github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test v0.0.0-20220317050137-1c8897fbd42c
6+
github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test v0.4.0
77
github.com/stretchr/testify v1.7.0
88
)

test/integration/go.sum

Lines changed: 779 additions & 155 deletions
Large diffs are not rendered by default.

test/integration/simple_workflow/simple_workflow_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestSimpleWorkflow(t *testing.T) {
3333
waitSeconds := 5
3434
bpt.DefaultVerify(assert)
3535

36-
projectId := bpt.GetStringOutput("project_id")
36+
projectId := bpt.GetTFSetupStringOutput("project_id")
3737
workflowId := bpt.GetStringOutput("workflow_id")
3838
workflowRevisionId := bpt.GetStringOutput("revision_id")
3939
gcOps := gcloud.WithCommonArgs([]string{"--project", projectId, "--location", "us-central1", "--format", "json"})

0 commit comments

Comments
 (0)