From e5a2aeeae6d127d5a2aeeb9adf71c077449a6b4d Mon Sep 17 00:00:00 2001 From: YuikoTakada Date: Tue, 14 Jan 2020 05:30:30 +0000 Subject: [PATCH] Fix static check failures in test/e2e/instrumentation/logging/stackdriver --- hack/.staticcheck_failures | 1 - test/e2e/instrumentation/logging/stackdriver/BUILD | 1 + test/e2e/instrumentation/logging/stackdriver/utils.go | 6 ++++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index ede50e41026..025235ad011 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -43,7 +43,6 @@ pkg/volume/util/subpath pkg/volume/vsphere_volume test/e2e/apps test/e2e/autoscaling -test/e2e/instrumentation/logging/stackdriver test/integration/deployment test/integration/etcd test/integration/examples diff --git a/test/e2e/instrumentation/logging/stackdriver/BUILD b/test/e2e/instrumentation/logging/stackdriver/BUILD index 762658846df..b88a71bf7ec 100644 --- a/test/e2e/instrumentation/logging/stackdriver/BUILD +++ b/test/e2e/instrumentation/logging/stackdriver/BUILD @@ -25,6 +25,7 @@ go_library( "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/golang.org/x/oauth2/google:go_default_library", "//vendor/google.golang.org/api/logging/v2beta1:go_default_library", + "//vendor/google.golang.org/api/option:go_default_library", "//vendor/google.golang.org/api/pubsub/v1:go_default_library", ], ) diff --git a/test/e2e/instrumentation/logging/stackdriver/utils.go b/test/e2e/instrumentation/logging/stackdriver/utils.go index 27360474a83..81ad806538e 100644 --- a/test/e2e/instrumentation/logging/stackdriver/utils.go +++ b/test/e2e/instrumentation/logging/stackdriver/utils.go @@ -30,6 +30,7 @@ import ( "golang.org/x/oauth2/google" sd "google.golang.org/api/logging/v2beta1" + "google.golang.org/api/option" pubsub "google.golang.org/api/pubsub/v1" ) @@ -85,7 +86,8 @@ type sdLogProvider struct { func newSdLogProvider(f *framework.Framework, scope logProviderScope) (*sdLogProvider, error) { ctx := context.Background() hc, err := google.DefaultClient(ctx, sd.CloudPlatformScope) - sdService, err := sd.New(hc) + framework.ExpectNoError(err) + sdService, err := sd.NewService(ctx, option.WithHTTPClient(hc)) if err != nil { return nil, err } @@ -94,7 +96,7 @@ func newSdLogProvider(f *framework.Framework, scope logProviderScope) (*sdLogPro return nil, err } - pubsubService, err := pubsub.New(hc) + pubsubService, err := pubsub.NewService(ctx, option.WithHTTPClient(hc)) if err != nil { return nil, err }