Skip to content

Commit bfa815b

Browse files
committed
Fix for compilation issues after merging
1 parent 490f1bf commit bfa815b

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require (
77
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190612171043-2e19bb35a278
88
github.com/container-storage-interface/spec v1.2.0
99
github.com/golang/protobuf v1.3.4
10+
github.com/google/btree v1.0.0 // indirect
1011
github.com/google/uuid v1.1.1
1112
github.com/hashicorp/go-multierror v1.0.0 // indirect
1213
github.com/kubernetes-csi/csi-proxy/client v0.0.0-20200330215040-9eff16441b2a

pkg/gce-cloud-provider/compute/fake-gce.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ func (cloud *FakeCloudProvider) ValidateExistingDisk(ctx context.Context, resp *
227227
reqBytes, common.GbToBytes(resp.GetSizeGb()), limBytes)
228228
}
229229

230-
respType := strings.Split(resp.GetType(), "/")
231-
typeMatch := strings.TrimSpace(respType[len(respType)-1]) == strings.TrimSpace(diskType)
232-
typeDefault := diskType == "" && strings.TrimSpace(respType[len(respType)-1]) == "pd-standard"
230+
respType := strings.Split(resp.GetPDType(), "/")
231+
typeMatch := strings.TrimSpace(respType[len(respType)-1]) == strings.TrimSpace(params.DiskType)
232+
typeDefault := params.DiskType == "" && strings.TrimSpace(respType[len(respType)-1]) == "pd-standard"
233233
if !typeMatch && !typeDefault {
234234
return fmt.Errorf("disk already exists with incompatible type. Need %v. Got %v",
235-
diskType, respType[len(respType)-1])
235+
params.DiskType, respType[len(respType)-1])
236236
}
237237

238238
// We are assuming here that a multiWriter disk could be used as non-multiWriter

pkg/gce-cloud-provider/compute/gce.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func CreateCloudProvider(ctx context.Context, vendorVersion string, configPath s
9292
return nil, err
9393
}
9494

95-
alphasvc, err := createAlphaCloudService(vendorVersion, tokenSource)
95+
alphasvc, err := createAlphaCloudService(ctx, vendorVersion, tokenSource)
9696
if err != nil {
9797
return nil, err
9898
}
@@ -158,8 +158,8 @@ func readConfig(configPath string) (*ConfigFile, error) {
158158
return cfg, nil
159159
}
160160

161-
func createAlphaCloudService(vendorVersion string, tokenSource oauth2.TokenSource) (*alpha.Service, error) {
162-
client, err := newOauthClient(tokenSource)
161+
func createAlphaCloudService(ctx context.Context, vendorVersion string, tokenSource oauth2.TokenSource) (*alpha.Service, error) {
162+
client, err := newOauthClient(ctx, tokenSource)
163163
if err != nil {
164164
return nil, err
165165
}

0 commit comments

Comments
 (0)