Skip to content

Commit

Permalink
fix(google-api-go-generator): add patch for compute mtls endpoint (#761)
Browse files Browse the repository at this point in the history
Compute discovery doc is currently missing MTLSRootURL since compute discovery doc is generated using old apiary pipeline, and it is not easy to fix. This is expected to be fixed after compute migrates to OP discovery doc gen in 2021. Adding a temporary patch for compute in the meantime. (Compute is the only service that has this issue, among the services we care about for MTLS.) Note that I specifically chose not to add a regex-based generic patch here in order to avoid masking MTLS endpoint issues with other services - if there are any issues, we need to triage them on a case by case basis.
  • Loading branch information
andyrzhao committed Dec 2, 2020
1 parent e8d19f9 commit 445fe0b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions google-api-go-generator/gen.go
Expand Up @@ -499,6 +499,11 @@ func (a *API) mtlsAPIBaseURL() string {
if a.doc.MTLSRootURL != "" {
return resolveRelative(a.doc.MTLSRootURL, a.doc.ServicePath)
}
// TODO(andyrzhao): Remove the workaround below when MTLSRootURL becomes available in
// compute discovery doc, after compute migrates to OP discovery doc gen (ETA 2021).
if a.doc.MTLSRootURL == "" && a.doc.RootURL == "https://compute.googleapis.com/" {
return resolveRelative("https://compute.mtls.googleapis.com/", a.doc.ServicePath)
}
return ""
}

Expand Down

0 comments on commit 445fe0b

Please sign in to comment.