From fbc3a41a8f08fcee6adbdd0fcf2e969ce6ca7cc7 Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Tue, 29 May 2018 16:32:39 +1000 Subject: [PATCH] Use the project defined in the trigger_template when creating trigger 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