From bb422ad5b93405bf73b87b3b29b29b96adf0ae7e Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Wed, 28 Aug 2024 19:47:38 +0200 Subject: [PATCH] GCS: add user agent Signed-off-by: Nicola Murino --- internal/vfs/gcsfs.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/vfs/gcsfs.go b/internal/vfs/gcsfs.go index c301915a..eb691624 100644 --- a/internal/vfs/gcsfs.go +++ b/internal/vfs/gcsfs.go @@ -88,7 +88,10 @@ func NewGCSFs(connectionID, localTempDir, mountPath string, config GCSFsConfig) } ctx := context.Background() if fs.config.AutomaticCredentials > 0 { - fs.svc, err = storage.NewClient(ctx, storage.WithJSONReads()) + fs.svc, err = storage.NewClient(ctx, + storage.WithJSONReads(), + option.WithUserAgent(version.GetVersionHash()), + ) } else { err = fs.config.Credentials.TryDecrypt() if err != nil { @@ -96,6 +99,7 @@ func NewGCSFs(connectionID, localTempDir, mountPath string, config GCSFsConfig) } fs.svc, err = storage.NewClient(ctx, storage.WithJSONReads(), + option.WithUserAgent(version.GetVersionHash()), option.WithCredentialsJSON([]byte(fs.config.Credentials.GetPayload())), ) }