Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions mmv1/templates/terraform/examples/base_configs/test_file.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

"{{ $.ImportPath }}/acctest"
"{{ $.ImportPath }}/envvar"
"{{ $.ImportPath }}/services/{{ lower $.Res.ProductMetadata.Name }}"
"{{ $.ImportPath }}/tpgresource"
transport_tpg "{{ $.ImportPath }}/transport"

Expand All @@ -48,6 +49,7 @@ var (
_ = tpgresource.SetLabels
_ = transport_tpg.Config{}
_ = googleapi.Error{}
_ = {{ lower $.Res.ProductMetadata.Name }}.Product
)

{{ range $e := $.Res.TestExamples }}
Expand Down Expand Up @@ -152,26 +154,15 @@ func testAccCheck{{ $.Res.ResourceName }}DestroyProducer(t *testing.T) func(s *t
{{- else }}

config := acctest.GoogleProviderConfig(t)
{{ if $.Res.ProductMetadata.Version.RepEnabled }}

urlFormatted, err := tpgresource.ReplaceVarsForTest(config, rs, "{{$.Res.SelfLinkUri}}")

if err != nil {
return err
}

loc := tpgresource.LocationFromId(urlFormatted)
basePath, err := transport_tpg.ResourceBasePath(config.{{$.Res.ProductMetadata.Name}}BasePath, config.{{$.Res.ProductMetadata.Name}}RepBasePath, "{{$.Res.ProductMetadata.Name}}", config, loc)
url, err := tpgresource.ReplaceVarsForTest(config, rs, fmt.Sprintf("%s%s", transport_tpg.BaseUrl({{ lower $.Res.ProductMetadata.Name }}.Product, config), "{{$.Res.SelfLinkUri}}"))
if err != nil {
return err
}
url := fmt.Sprintf("%s%s", basePath, urlFormatted)
{{- else }}
url, err := tpgresource.ReplaceVarsForTest(config, rs, "{{"{{"}}{{$.Res.ProductMetadata.Name}}{{"BasePath}}"}}{{$.Res.SelfLinkUri}}")
if err != nil {
return err
{{- if $.Res.ProductMetadata.Version.RepEnabled }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could make sense to unguard this as having {{location}} in any url is probably a failure mode

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH we might want to flag it as a failure mode if any {} characters are present in a URL... or maybe that should be an error returned by ReplaceVars if there's any replacement that didn't happen?

In either case - I'd be happy to make that change, but it'll probably be as a separate PR for clarity / to avoid blocking this one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Putting it in ReplaceVars would make sense, but I have a suspicion it would trigger errors on places we've handled replacement afterwards.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looking into this: #17419

if strings.Contains(url, "{{"{{"}}location{{"}}"}}") {
return fmt.Errorf("failed to qualify endpoint for a resource with a regionalized endpoint %s", url)
}
{{- end }}
{{- end }}

billingProject := ""

Expand Down
18 changes: 10 additions & 8 deletions mmv1/templates/terraform/operation.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,18 @@ func (w *{{ $.ProductMetadata.Name }}OperationWaiter) QueryOp() (interface{}, er
if w == nil {
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
}
// Returns the proper get.
url := fmt.Sprintf(
"%s%s",
transport_tpg.BaseUrl(Product, w.Config),
fmt.Sprintf("{{ replaceAll $.GetAsync.Operation.BaseUrl "{{op_id}}" "%s" }}", w.CommonOperationWaiter.Op.Name),
)
{{- if $.ProductMetadata.Version.RepEnabled }}
basePath, err := transport_tpg.ResourceBasePath(w.Config.{{$.ProductMetadata.Name}}BasePath, w.Config.{{$.ProductMetadata.Name}}RepBasePath, "{{$.ProductMetadata.Name}}", w.Config, w.Location)
if err != nil {
return nil, err
if strings.Contains(url, "{{"{{"}}location{{"}}"}}") && w.Location == "" {
return nil, fmt.Errorf("failed to find location for a resource with a regionalized endpoint %s", url)
}
url := fmt.Sprintf("%s{{ replaceAll $.GetAsync.Operation.BaseUrl "{{op_id}}" "%s" }}", basePath, w.CommonOperationWaiter.Op.Name)
{{ else }}
// Returns the proper get.
url := fmt.Sprintf("%s{{ replaceAll $.GetAsync.Operation.BaseUrl "{{op_id}}" "%s" }}", w.Config.{{ $.ProductMetadata.Name }}BasePath, w.CommonOperationWaiter.Op.Name)
{{ end }}
url = strings.ReplaceAll(url, "{{"{{"}}location{{"}}"}}", w.Location)
{{- end }}
return transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: w.Config,
Method: "GET",
Expand Down
1 change: 1 addition & 0 deletions mmv1/templates/terraform/product.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var Product = registry.Product{
BaseUrl: "{{ $.Version.BaseUrl }}",
{{- if $.Version.RepUrl }}
RepUrl: "{{ $.Version.RepUrl }}",
RepByDefault: {{ $.RepByDefault }},
{{- end }}
CustomEndpointField: "{{ underscore $.Name }}_custom_endpoint",
CustomEndpointEnvVar: "GOOGLE_{{ upper (underscore $.Name) }}_CUSTOM_ENDPOINT",
Expand Down
136 changes: 37 additions & 99 deletions mmv1/templates/terraform/resource.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -292,27 +292,15 @@ func resource{{ $.ResourceName -}}Create(d *schema.ResourceData, meta interface{
defer transport_tpg.MutexStore.Unlock(lockName)
{{- end}}

{{- if $.ProductMetadata.Version.RepEnabled }}
urlFormatted, err := tpgresource.ReplaceVars(d, config, "{{$.CreateUri}}")
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, fmt.Sprintf("%s%s", transport_tpg.BaseUrl(Product, config), "{{$.CreateUri}}"))
if err != nil {
return err
}
loc := tpgresource.LocationFromId(urlFormatted)

basePath, err := transport_tpg.ResourceBasePath(config.{{$.ProductMetadata.Name}}BasePath, config.{{$.ProductMetadata.Name}}RepBasePath, "{{$.ProductMetadata.Name}}", config, loc)
if err != nil {
return fmt.Errorf("Error qualifying Create base path for {{ $.Name -}}: %s", err)
{{- if $.ProductMetadata.Version.RepEnabled }}
if strings.Contains(url, "{{"{{"}}location{{"}}"}}") {
return fmt.Errorf("failed to qualify endpoint for a resource with a regionalized endpoint %s", url)
}

url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{$.CreateUri}}")
url = fmt.Sprintf("%s%s", basePath, url)
{{ else }}

url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{"{{"}}{{$.ProductMetadata.Name}}BasePath{{"}}"}}{{$.CreateUri}}")
{{- end }}
if err != nil {
return err
}

log.Printf("[DEBUG] Creating new {{ $.Name -}}: %#v", obj)
{{- if $.NestedQuery -}}
Expand Down Expand Up @@ -564,28 +552,16 @@ func resource{{ $.ResourceName -}}PollRead(d *schema.ResourceData, meta interfac
return func() (map[string]interface{}, error) {
config := meta.(*transport_tpg.Config)

{{ if $.ProductMetadata.Version.RepEnabled }}
urlFormatted, err := tpgresource.ReplaceVars(d, config, "{{$.CreateUri}}")
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, fmt.Sprintf("%s%s", transport_tpg.BaseUrl(Product, config), "{{$.SelfLinkUri}}"))
if err != nil {
return err
return nil, err
}
loc := tpgresource.LocationFromId(urlFormatted)

basePath := transport_tpg.ResourceBasePath(config.{{$.ProductMetadata.Name}}BasePath, config.{{$.ProductMetadata.Name}}RepBasePath, "{{$.ProductMetadata.Name}}", config, loc)
if err != nil {
return fmt.Errorf("Error qualifying base path for {{ $.Name -}}: %s", err)
{{- if $.ProductMetadata.Version.RepEnabled }}
if strings.Contains(url, "{{"{{"}}location{{"}}"}}") {
return fmt.Errorf("failed to qualify endpoint for a resource with a regionalized endpoint %s", url)
}

url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{$.SelfLinkUri}}")
url = fmt.Sprintf("%s%s", basePath, url)
{{ else }}
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{"{{"}}{{$.ProductMetadata.Name}}BasePath{{"}}"}}{{$.SelfLinkUri}}")
{{- end }}

if err != nil {
return nil, err
}

billingProject := ""

{{if $.HasProject -}}
Expand Down Expand Up @@ -672,26 +648,15 @@ func resource{{ $.ResourceName -}}Read(d *schema.ResourceData, meta interface{})
return err
}

{{- if $.ProductMetadata.Version.RepEnabled }}
urlFormatted, err := tpgresource.ReplaceVars(d, config, "{{$.CreateUri}}")
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, fmt.Sprintf("%s%s", transport_tpg.BaseUrl(Product, config), "{{$.SelfLinkUri}}{{$.ReadQueryParams}}"))
if err != nil {
return err
}
loc := tpgresource.LocationFromId(urlFormatted)

basePath, err := transport_tpg.ResourceBasePath(config.{{$.ProductMetadata.Name}}BasePath, config.{{$.ProductMetadata.Name}}RepBasePath, "{{$.ProductMetadata.Name}}", config, loc)
if err != nil {
return fmt.Errorf("Error qualifying base path for {{ $.Name -}}: %s", err)
{{- if $.ProductMetadata.Version.RepEnabled }}
if strings.Contains(url, "{{"{{"}}location{{"}}"}}") {
return fmt.Errorf("failed to qualify endpoint for a resource with a regionalized endpoint %s", url)
}
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{$.SelfLinkUri}}{{$.ReadQueryParams}}")
url = fmt.Sprintf("%s%s", basePath, url)
{{ else }}

url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{"{{"}}{{$.ProductMetadata.Name}}BasePath{{"}}"}}{{$.SelfLinkUri}}{{$.ReadQueryParams}}")
{{- end }}
if err != nil {
return err
}

billingProject := ""

Expand Down Expand Up @@ -962,22 +927,15 @@ func resource{{ $.ResourceName -}}Update(d *schema.ResourceData, meta interface{
defer transport_tpg.MutexStore.Unlock(lockName)
{{- end}}

{{- if $.ProductMetadata.Version.RepEnabled }}
loc := tpgresource.LocationFromId(d.Id())

basePath, err := transport_tpg.ResourceBasePath(config.{{$.ProductMetadata.Name}}BasePath, config.{{$.ProductMetadata.Name}}RepBasePath, "{{$.ProductMetadata.Name}}", config, loc)
if err != nil {
return fmt.Errorf("Error qualifying base path for {{ $.Name -}}: %s", err)
}
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{ $.UpdateUri }}")
url = fmt.Sprintf("%s%s", basePath, url)
{{ else }}

url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{"{{"}}{{$.ProductMetadata.Name}}BasePath{{"}}"}}{{ $.UpdateUri }}")
{{- end }}
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, fmt.Sprintf("%s%s", transport_tpg.BaseUrl(Product, config), "{{ $.UpdateUri }}"))
if err != nil {
return err
}
{{- if $.ProductMetadata.Version.RepEnabled }}
if strings.Contains(url, "{{"{{"}}location{{"}}"}}") {
return fmt.Errorf("failed to qualify endpoint for a resource with a regionalized endpoint %s", url)
}
{{- end }}

log.Printf("[DEBUG] Updating {{ $.Name }} %q: %#v", d.Id(), obj)
headers := make(http.Header)
Expand Down Expand Up @@ -1072,22 +1030,15 @@ if len(updateMask) > 0 {
if d.HasChange("{{ join ($.PropertyNamesToStrings (index $CustomUpdateProps $group)) "\") || d.HasChange(\""}}") {
obj := make(map[string]interface{})
{{ if $group.FingerprintName }}
{{- if $.ProductMetadata.Version.RepEnabled }}
loc := tpgresource.LocationFromId(d.Id())

basePath, err := transport_tpg.ResourceBasePath(config.{{$.ProductMetadata.Name}}BasePath, config.{{$.ProductMetadata.Name}}RepBasePath, "{{$.ProductMetadata.Name}}", config, loc)
if err != nil {
return fmt.Errorf("Error qualifying base path for {{ $.Name -}}: %s", err)
}
getUrl, err := tpgresource.ReplaceVars(d, config, "{{ $.UpdateUri }}")
getUrl = fmt.Sprintf("%s%s", basePath, getUrl)
{{ else }}

getUrl, err := tpgresource.ReplaceVars(d, config, "{{"{{"}}{{$.ProductMetadata.Name}}BasePath{{"}}"}}{{$.SelfLinkUri}}")
{{- end }}
getUrl, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, fmt.Sprintf("%s%s", transport_tpg.BaseUrl(Product, config), "{{$.SelfLinkUri}}"))
if err != nil {
return err
}
{{- if $.ProductMetadata.Version.RepEnabled }}
if strings.Contains(getUrl, "{{"{{"}}location{{"}}"}}") {
return fmt.Errorf("failed to qualify endpoint for a resource with a regionalized endpoint %s", getUrl)
}
{{- end }}
{{ if $.SupportsIndirectUserProjectOverride -}}
if parts := regexp.MustCompile(`projects\/([^\/]+)\/`).FindStringSubmatch(url); parts != nil {
billingProject = parts[1]
Expand Down Expand Up @@ -1166,21 +1117,15 @@ if d.HasChange("{{ join ($.PropertyNamesToStrings (index $CustomUpdateProps $gro
transport_tpg.MutexStore.Lock(lockName)
defer transport_tpg.MutexStore.Unlock(lockName)
{{- end}}
{{- if $.ProductMetadata.Version.RepEnabled }}
loc := tpgresource.LocationFromId(d.Id())

basePath, err := transport_tpg.ResourceBasePath(config.{{$.ProductMetadata.Name}}BasePath, config.{{$.ProductMetadata.Name}}RepBasePath, "{{$.ProductMetadata.Name}}", config, loc)
if err != nil {
return fmt.Errorf("Error qualifying base path for {{ $.Name -}}: %s", err)
}
url, err := tpgresource.ReplaceVars(d, config, "{{ $group.UpdateUrl }}")
url = fmt.Sprintf("%s%s", basePath, url)
{{ else }}
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{"{{"}}{{$.ProductMetadata.Name}}BasePath{{"}}"}}{{ $group.UpdateUrl }}"){{- end }}
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, fmt.Sprintf("%s%s", transport_tpg.BaseUrl(Product, config), "{{ $group.UpdateUrl }}"))
if err != nil {
return err
}

{{- if $.ProductMetadata.Version.RepEnabled }}
if strings.Contains(url, "{{"{{"}}location{{"}}"}}") {
return fmt.Errorf("failed to qualify endpoint for a resource with a regionalized endpoint %s", url)
}
{{- end }}

headers := make(http.Header)
{{ if $.CustomCode.PreUpdate -}}
Expand Down Expand Up @@ -1303,22 +1248,15 @@ func resource{{ $.ResourceName }}Delete(d *schema.ResourceData, meta interface{}
transport_tpg.MutexStore.Lock(lockName)
defer transport_tpg.MutexStore.Unlock(lockName)
{{- end }}
{{- if $.ProductMetadata.Version.RepEnabled }}
loc := tpgresource.LocationFromId(d.Id())

basePath, err := transport_tpg.ResourceBasePath(config.{{$.ProductMetadata.Name}}BasePath, config.{{$.ProductMetadata.Name}}RepBasePath, "{{$.ProductMetadata.Name}}", config, loc)
if err != nil {
return fmt.Errorf("Error qualifying base path for {{ $.Name -}}: %s", err)
}
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{$.DeleteUri}}")
url = fmt.Sprintf("%s%s", basePath, url)
{{ else }}

url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, "{{"{{"}}{{$.ProductMetadata.Name}}BasePath{{"}}"}}{{$.DeleteUri}}")
{{- end }}
url, err := tpgresource.ReplaceVars{{if $.LegacyLongFormProject -}}ForId{{ end -}}(d, config, fmt.Sprintf("%s%s", transport_tpg.BaseUrl(Product, config), "{{$.DeleteUri}}"))
if err != nil {
return err
}
{{- if $.ProductMetadata.Version.RepEnabled }}
if strings.Contains(url, "{{"{{"}}location{{"}}"}}") {
return fmt.Errorf("failed to qualify endpoint for a resource with a regionalized endpoint %s", url)
}
{{- end }}
{{/*If the deletion of the object requires sending a request body, the custom code will set 'obj' */}}
var obj map[string]interface{}
{{- if and $.NestedQuery $.NestedQuery.ModifyByPatch }}
Expand Down
23 changes: 7 additions & 16 deletions mmv1/templates/terraform/samples/base_configs/test_file.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (

"{{ $.ImportPath }}/acctest"
"{{ $.ImportPath }}/envvar"
"{{ $.ImportPath }}/services/{{ lower $.Res.ProductMetadata.Name }}"
"{{ $.ImportPath }}/tpgresource"
transport_tpg "{{ $.ImportPath }}/transport"

Expand All @@ -58,6 +59,7 @@ var (
_ = tpgresource.SetLabels
_ = transport_tpg.Config{}
_ = googleapi.Error{}
_ = {{ lower $.Res.ProductMetadata.Name }}.Product
)

{{ range $s := $.Res.TestSamples }}
Expand Down Expand Up @@ -185,26 +187,15 @@ func testAccCheck{{ $.Res.ResourceName }}DestroyProducer(t *testing.T) func(s *t
{{- else }}

config := acctest.GoogleProviderConfig(t)

{{ if $.Res.ProductMetadata.Version.RepEnabled }}
urlFormatted, err := tpgresource.ReplaceVarsForTest(config, rs, "{{$.Res.SelfLinkUri}}")

url, err := tpgresource.ReplaceVarsForTest(config, rs, fmt.Sprintf("%s%s", transport_tpg.BaseUrl({{ lower $.Res.ProductMetadata.Name }}.Product, config), "{{$.Res.SelfLinkUri}}"))
if err != nil {
return err
}

loc := tpgresource.LocationFromId(urlFormatted)
basePath, err := transport_tpg.ResourceBasePath(config.{{$.Res.ProductMetadata.Name}}BasePath, config.{{$.Res.ProductMetadata.Name}}RepBasePath, "{{$.Res.ProductMetadata.Name}}", config, loc)
if err != nil {
return err
{{- if $.Res.ProductMetadata.Version.RepEnabled }}
if strings.Contains(url, "{{"{{"}}location{{"}}"}}") {
return fmt.Errorf("failed to qualify endpoint for a resource with a regionalized endpoint %s", url)
}
url := fmt.Sprintf("%s%s", basePath, urlFormatted)
{{- else }}
url, err := tpgresource.ReplaceVarsForTest(config, rs, "{{"{{"}}{{$.Res.ProductMetadata.Name}}{{"BasePath}}"}}{{$.Res.SelfLinkUri}}")
if err != nil {
return err
}
{{- end }}
{{- end }}

billingProject := ""

Expand Down
3 changes: 0 additions & 3 deletions mmv1/third_party/terraform/provider/provider.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,6 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
// Registered products
{{- range $product := $.Products }}
config.{{ $product.Name }}BasePath = transport_tpg.BaseUrl(registry.GetProduct("{{ lower $product.Name }}"), &config)
{{- if $product.Version.RepEnabled }}
config.{{ $product.Name }}RepBasePath = registry.GetProduct("{{ lower $product.Name }}").RepUrl
{{- end -}}
{{- end }}

stopCtx, ok := schema.StopContext(ctx)
Expand Down
2 changes: 2 additions & 0 deletions mmv1/third_party/terraform/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type Product struct {
BaseUrl string
// RepUrl is the base URL for regional API requests. It may contain Magic Modules templating directives.
RepUrl string
// RepByDefault is if this product should default to REP endpoints if available.
RepByDefault bool
// CustomEndpointField is the name of the product's custom endpoint field in the provider schema.
CustomEndpointField string
// CustomEndpointEnvVar is the name of the product's custom endpoint environment variable.
Expand Down
22 changes: 15 additions & 7 deletions mmv1/third_party/terraform/transport/base_url.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,29 @@ import (

// Returns the base URL for a product taking into account the following rules:
// 1. If there is a custom endpoint set, return that immediately.
// 2. Otherwise, start with the base URL for the product.
// 2. If mTLS is active, make necessary adjustments.
// 3. If universe_domain is active, make necessary adjustments.
// 2. Otherwise, determine whether to use the REP url or standard url.
// 3. Make adjustments for mTLS / universe domain.
// 4. Return final URL.
func BaseUrl(product registry.Product, config *Config) string {
if v := config.CustomEndpoints[product.CustomEndpointField]; v != "" {
return v
}

path := product.BaseUrl
u := product.BaseUrl
if config.PreferRegionalEndpoints && product.RepUrl != "" {
u = product.RepUrl
} else if config.PreferGlobalEndpoints {
u = product.BaseUrl
} else if product.RepByDefault && product.RepUrl != "" {
u = product.RepUrl
}

if config.IsMtls {
path = GetMtlsEndpoint(product.BaseUrl)
u = GetMtlsEndpoint(u)
}
if config.UniverseDomain != "" && config.UniverseDomain != "googleapis.com" {
path = strings.ReplaceAll(path, "googleapis.com", config.UniverseDomain)
u = strings.ReplaceAll(u, "googleapis.com", config.UniverseDomain)
}
return path

return u
}
Loading
Loading