|
8 | 8 | "cloud.google.com/go/compute/metadata"
|
9 | 9 | "github.com/sirupsen/logrus"
|
10 | 10 | "golang.org/x/net/context"
|
11 |
| - "golang.org/x/oauth2/google" |
12 | 11 | compute "google.golang.org/api/compute/v0.beta"
|
13 | 12 | container "google.golang.org/api/container/v1"
|
14 | 13 | )
|
@@ -74,17 +73,12 @@ func getServices(ctx context.Context) (*container.Service, *compute.Service, err
|
74 | 73 | // We'll use the current host ServiceAccount if possible. If not available,
|
75 | 74 | // pass auth according to https://cloud.google.com/docs/authentication/
|
76 | 75 | // (ie. via GOOGLE_APPLICATION_CREDENTIALS environment or otherwise).
|
77 |
| - hc, err := google.DefaultClient(ctx, container.CloudPlatformScope, compute.CloudPlatformScope) |
78 |
| - if err != nil { |
79 |
| - return nil, nil, fmt.Errorf("could not get authenticated client: %v", err) |
80 |
| - } |
81 |
| - |
82 |
| - svc, err := container.New(hc) |
| 76 | + svc, err := container.NewService(ctx) |
83 | 77 | if err != nil {
|
84 | 78 | return nil, nil, fmt.Errorf("could not initialize gke client: %v", err)
|
85 | 79 | }
|
86 | 80 |
|
87 |
| - csvc, err := compute.New(hc) |
| 81 | + csvc, err := compute.NewService(ctx) |
88 | 82 | if err != nil {
|
89 | 83 | return nil, nil, fmt.Errorf("could not initialize compute client: %v", err)
|
90 | 84 | }
|
|
0 commit comments