Merge pull request #81932 from palnabarun/fix-staticcheck-tests-e2e_node

Fixes static check failures in test/e2e_node/*
This commit is contained in:
Kubernetes Prow Robot
2019-09-20 22:55:37 -07:00
committed by GitHub
10 changed files with 20 additions and 41 deletions

View File

@@ -19,9 +19,9 @@ go_library(
"//test/e2e_node/remote:go_default_library",
"//test/e2e_node/system:go_default_library",
"//vendor/github.com/pborman/uuid:go_default_library",
"//vendor/golang.org/x/oauth2:go_default_library",
"//vendor/golang.org/x/oauth2/google:go_default_library",
"//vendor/google.golang.org/api/compute/v0.beta:go_default_library",
"//vendor/google.golang.org/api/option:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
"//vendor/sigs.k8s.io/yaml:go_default_library",
],

View File

@@ -40,9 +40,9 @@ import (
"k8s.io/kubernetes/test/e2e_node/system"
"github.com/pborman/uuid"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
compute "google.golang.org/api/compute/v0.beta"
"google.golang.org/api/option"
"k8s.io/klog"
"sigs.k8s.io/yaml"
)
@@ -726,12 +726,12 @@ func getComputeClient() (*compute.Service, error) {
}
var client *http.Client
client, err = google.DefaultClient(oauth2.NoContext, compute.ComputeScope)
client, err = google.DefaultClient(context.Background(), compute.ComputeScope)
if err != nil {
continue
}
cs, err = compute.New(client)
cs, err = compute.NewService(context.Background(), option.WithHTTPClient(client))
if err != nil {
continue
}