GoogleCloudPlatform / GoogleCloudPlatform/esp-v2
Use FindDefaultCredentials and a local ADC when the metadata server isn't available
- Dominant language
- Go
- Stars
- 307
- Forks
- 185
- Avg merge
- 14h 45m
- Merged PRs (30d)
- 6
Description
I've been removing unnecessary dependencies on exported Service Account keys (see https://github.com/google/osv.dev/pull/822 for context), which works as desired using Cloud Build's default Service Account when running under Cloud Build.
When running locally, things go south at https://github.com/GoogleCloudPlatform/esp-v2/blob/5c4538a5a46f34e30fca009cd190934fd366ceee/src/go/configmanager/config_manager.go#L137 though because of the lack of a metadata server.
Someone who knows more about Cloud Identity matters than me pointed me at https://pkg.go.dev/golang.org/x/oauth2/google#FindDefaultCredentials, which by the looks of it would fall back to a local ADC in the event of the metadata server not being available.
Contributor guide
Assessment
This issue has not been assessed yet.