Skip to content
Permalink
Browse files

fix(google-api-go-generator): add patch for compute mtls endpoint (#761)

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 445fe0be627de9769c5b252e77858c78682a6b8c
Showing with 5 additions and 0 deletions.
  1. +5 −0 google-api-go-generator/gen.go
@@ -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 ""
}

0 comments on commit 445fe0b

Please sign in to comment.