Skip to content

Commit

Permalink
Use the project defined in the trigger_template when creating trigger (
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
jamielennox authored and rosbo committed May 29, 2018
1 parent cdcda83 commit cd83bab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion google/resource_cloudbuild_build_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cd83bab

Please sign in to comment.