Closed
Description
From #3302:
I finally got around to testing #3306. Unfortunately it doesn't work.
I suspect the issue is the creds
used when there is no ADC is empty:
creds = &google.Credentials{}
So creds.TokenSource
is not set and the API requests fail.
One possibility for solving this is using something like the following to generate a valid creds
instance:
creds, _ = google.CredentialsFromJSON(ctx, []byte(`{"type": "service_account"}`))
Or use golang.org/x/oauth2/jwt to create the token source:
creds.TokenSource = &jwt.Config{
Scopes: []string{"https://www.googleapis.com/auth/cloud-platform"},
TokenURL: google.JWTTokenURL,
}.TokenSource(ctx)
Metadata
Metadata
Assignees
Labels
No labels