Skip to content

Commit

Permalink
gcs: Fixed scopes for inline ServiceAccount option.
Browse files Browse the repository at this point in the history
Without this that option was unusable.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
  • Loading branch information
bwplotka committed Apr 15, 2019
1 parent e6d5b49 commit 98bfbda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/objstore/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ func NewBucket(ctx context.Context, logger log.Logger, conf []byte, component st

// If ServiceAccount is provided, use them in GCS client, otherwise fallback to Google default logic.
if gc.ServiceAccount != "" {
credentials, err := google.CredentialsFromJSON(ctx, []byte(gc.ServiceAccount))
credentials, err := google.CredentialsFromJSON(ctx, []byte(gc.ServiceAccount), storage.ScopeFullControl)
if err != nil {
return nil, errors.Wrap(err, "failed to create credentials from JSON")
}
opts = append(opts, option.WithCredentials(credentials))
}

opts = append(opts,
option.WithScopes(storage.ScopeFullControl),
option.WithUserAgent(fmt.Sprintf("thanos-%s/%s (%s)", component, version.Version, runtime.Version())),
)

Expand Down

0 comments on commit 98bfbda

Please sign in to comment.