Fix static check failures in test/e2e/instrumentation/logging/stackdriver

This commit is contained in:
YuikoTakada 2020-01-14 05:30:30 +00:00
parent e6b5194ec1
commit e5a2aeeae6
3 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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",
],
)

View File

@ -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
}