aboutsummaryrefslogtreecommitdiff
path: root/vendor/go4.org/wkfs/gcs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/go4.org/wkfs/gcs')
-rw-r--r--vendor/go4.org/wkfs/gcs/gcs.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/vendor/go4.org/wkfs/gcs/gcs.go b/vendor/go4.org/wkfs/gcs/gcs.go
index 21f2551..a970c75 100644
--- a/vendor/go4.org/wkfs/gcs/gcs.go
+++ b/vendor/go4.org/wkfs/gcs/gcs.go
@@ -32,13 +32,13 @@ import (
"strings"
"time"
+ "cloud.google.com/go/compute/metadata"
+ "cloud.google.com/go/storage"
"go4.org/wkfs"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
- "google.golang.org/cloud"
- "google.golang.org/cloud/compute/metadata"
- "google.golang.org/cloud/storage"
+ "google.golang.org/api/option"
)
// Max size for all files read, because we use a bytes.Reader as our file
@@ -56,13 +56,8 @@ func init() {
registerBrokenFS(fmt.Errorf("could not get http client for context: %v", err))
return
}
- projID, err := metadata.ProjectID()
- if projID == "" || err != nil {
- registerBrokenFS(fmt.Errorf("could not get GCE project ID: %v", err))
- return
- }
- ctx := cloud.NewContext(projID, hc)
- sc, err := storage.NewClient(ctx)
+ ctx := context.Background()
+ sc, err := storage.NewClient(ctx, option.WithHTTPClient(hc))
if err != nil {
registerBrokenFS(fmt.Errorf("could not get cloud storage client: %v", err))
return