Set Minio user-agent for GCS calls (#5154)

master
Krishna Srinivas 7 years ago committed by Dee Koder
parent b63c37b28e
commit 7d3eaf79ff
  1. 5
      cmd/gateway-gcs.go

@ -39,6 +39,7 @@ import (
cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v1" cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v1"
"google.golang.org/api/googleapi" "google.golang.org/api/googleapi"
"google.golang.org/api/iterator" "google.golang.org/api/iterator"
"google.golang.org/api/option"
) )
var ( var (
@ -381,7 +382,9 @@ func newGCSGatewayLayer(projectID string) (GatewayLayer, error) {
} }
// Initialize a GCS client. // Initialize a GCS client.
client, err := storage.NewClient(ctx) // Send user-agent in this format for Google to obtain usage insights while participating in the
// Google Cloud Technology Partners (https://cloud.google.com/partners/)
client, err := storage.NewClient(ctx, option.WithUserAgent(fmt.Sprintf("Minio/%s (GPN:Minio;)", Version)))
if err != nil { if err != nil {
return nil, err return nil, err
} }

Loading…
Cancel
Save