Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/login/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// Login checks if passed gcp credentials are correct.
func Login(ctx context.Context, reg string) error {
// Check that we can find a valid token source using GCE or ApplicationDefault.
ts, err := google.DefaultTokenSource(ctx)
ts, err := google.DefaultTokenSource(ctx, "https://www.googleapis.com/auth/cloud-platform")
if err != nil {
return fmt.Errorf("wrong GCP token source, unable to find a valid source: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/oci/authn/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func GCPCredential(ctx context.Context, reg string) (auth.Credential, error) {

// load saved tokenSource or saves it
if SavedTokenSource == nil {
tokenSource, err = google.DefaultTokenSource(ctx)
tokenSource, err = google.DefaultTokenSource(ctx, "https://www.googleapis.com/auth/cloud-platform")
if err != nil {
return auth.EmptyCredential, fmt.Errorf("error while trying to identify a GCP TokenSource %w", err)
}
Expand Down
Loading