Skip to content

Commit

Permalink
resource/url: update scope, and projectID to 'with context' variants
Browse files Browse the repository at this point in the history
  • Loading branch information
prestist committed Nov 11, 2024
1 parent 488ce74 commit b29af5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/resource/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ func (f *Fetcher) fetchFromGCS(u url.URL, dest io.Writer, opts FetchOptions) err
if metadata.OnGCE() {
// check whether the VM is associated with a service
// account
if _, err := metadata.Scopes(""); err == nil {
id, _ := metadata.ProjectID()
if _, err := metadata.ScopesWithContext(ctx, ""); err == nil {
id, _ := metadata.ProjectIDWithContext(ctx)
creds := &google.Credentials{
ProjectID: id,
TokenSource: google.ComputeTokenSource("", storage.ScopeReadOnly),
Expand Down

0 comments on commit b29af5e

Please sign in to comment.