From cd83bab7dc606f9438b0a0abde21a57397a175fd Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Wed, 30 May 2018 04:38:12 +1000 Subject: [PATCH] Use the project defined in the trigger_template when creating trigger (#1556) When creating a trigger by using the project defined in the schema we enforce that the repo must be in that same project. We should be looking at the project defined in the trigger_template data and falling back to that first project if not found. Closes: #1555 --- google/resource_cloudbuild_build_trigger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/resource_cloudbuild_build_trigger.go b/google/resource_cloudbuild_build_trigger.go index a4236ed2e94..4a96e5a4315 100644 --- a/google/resource_cloudbuild_build_trigger.go +++ b/google/resource_cloudbuild_build_trigger.go @@ -191,7 +191,7 @@ func expandCloudbuildBuildTriggerTemplate(d *schema.ResourceData, project string return nil } tmpl := &cloudbuild.RepoSource{} - if v, ok := d.GetOk("project"); ok { + if v, ok := d.GetOk("trigger_template.0.project"); ok { tmpl.ProjectId = v.(string) } else { tmpl.ProjectId = project