Skip to content

Commit

Permalink
Merge pull request #1407 from cheftako/tpc
Browse files Browse the repository at this point in the history
  • Loading branch information
google-oss-prow[bot] committed Apr 8, 2024
2 parents 4647b3c + 68a32da commit 01c3b76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,6 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
if err != nil {
return nil, diag.FromErr(err)
}
transport_tpg.HandleDCLCustomEndpointDefaults(d)

config := transport_tpg.Config{
Project: d.Get("project").(string),
Expand Down Expand Up @@ -2035,6 +2034,12 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
}
}

err = transport_tpg.SetEndpointDefaults(d)
if err != nil {
return nil, diag.FromErr(err)
}
transport_tpg.HandleDCLCustomEndpointDefaults(d)

// Given that impersonate_service_account is a secondary auth method, it has
// no conflicts to worry about. We pull the env var in a DefaultFunc.
if v, ok := d.GetOk("impersonate_service_account"); ok {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,10 @@ func HandleSDKDefaults(d *schema.ResourceData) error {
"CLOUDSDK_CORE_REQUEST_REASON",
}, nil))
}
return nil
}

func SetEndpointDefaults(d *schema.ResourceData) error {
// Generated Products
if d.Get("access_approval_custom_endpoint") == "" {
d.Set("access_approval_custom_endpoint", MultiEnvDefault([]string{
Expand Down

0 comments on commit 01c3b76

Please sign in to comment.