Skip to content

Commit 547bc8b

Browse files
committed
Update logic to use SI for VACs
1 parent b286fc5 commit 547bc8b

File tree

8 files changed

+14
-29
lines changed

8 files changed

+14
-29
lines changed

Diff for: deploy/kubernetes/overlays/dev/driver-args.yaml

-7
This file was deleted.

Diff for: deploy/kubernetes/overlays/dev/kustomization.yaml

-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ resources:
99
# Here dev overlay is using the same image as alpha
1010
transformers:
1111
- ../../images/stable-master
12-
# Apply patches to support dynamic provisioning for hyperdisks
13-
patches:
14-
- path: ./driver-args.yaml
15-
target:
16-
group: apps
17-
version: v1
18-
kind: Deployment
19-
name: csi-gce-pd-controller
2012
# To change the dev image, add something like the following.
2113
#images:
2214
#- name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver

Diff for: examples/kubernetes/demo-vol-create.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ metadata:
1616
driverName: pd.csi.storage.gke.io
1717
parameters:
1818
iops: "3000"
19-
throughput: "150"
19+
throughput: "150Mi"
2020
---
2121
apiVersion: storage.k8s.io/v1beta1
2222
kind: VolumeAttributesClass
@@ -25,7 +25,7 @@ metadata:
2525
driverName: pd.csi.storage.gke.io
2626
parameters:
2727
iops: "3013"
28-
throughput: "151"
28+
throughput: "151Mi"
2929
---
3030
apiVersion: v1
3131
kind: PersistentVolumeClaim

Diff for: pkg/common/parameters.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func ExtractModifyVolumeParameters(parameters map[string]string) (ModifyVolumePa
343343
}
344344
modifyVolumeParams.IOPS = &iops
345345
case "throughput":
346-
throughput, err := ConvertStringToInt64(value)
346+
throughput, err := ConvertMiStringToInt64(value)
347347
if err != nil {
348348
return ModifyVolumeParameters{}, fmt.Errorf("parameters contain invalid throughput parameter: %w", err)
349349
}

Diff for: pkg/common/parameters_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ func TestSnapshotParameters(t *testing.T) {
485485
func TestExtractModifyVolumeParameters(t *testing.T) {
486486
parameters := map[string]string{
487487
"iops": "1000",
488-
"throughput": "500",
488+
"throughput": "500Mi",
489489
}
490490

491491
iops := int64(1000)

Diff for: pkg/gce-pd-csi-driver/controller_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@ func TestCreateVolumeWithVolumeAttributeClassParameters(t *testing.T) {
17891789
},
17901790
},
17911791
},
1792-
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
1792+
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
17931793
},
17941794
expIops: 20000,
17951795
expThroughput: 600,
@@ -1822,7 +1822,7 @@ func TestCreateVolumeWithVolumeAttributeClassParameters(t *testing.T) {
18221822
},
18231823
},
18241824
},
1825-
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
1825+
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
18261826
},
18271827
expIops: 0,
18281828
expThroughput: 0,
@@ -1890,7 +1890,7 @@ func TestVolumeModifyOperation(t *testing.T) {
18901890
name: "Update volume with valid parameters",
18911891
req: &csi.ControllerModifyVolumeRequest{
18921892
VolumeId: testVolumeID,
1893-
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
1893+
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
18941894
},
18951895
diskType: "hyperdisk-balanced",
18961896
params: &common.DiskParameters{
@@ -1906,7 +1906,7 @@ func TestVolumeModifyOperation(t *testing.T) {
19061906
name: "Update volume with invalid parameters",
19071907
req: &csi.ControllerModifyVolumeRequest{
19081908
VolumeId: testVolumeID,
1909-
MutableParameters: map[string]string{"iops": "0", "throughput": "0"},
1909+
MutableParameters: map[string]string{"iops": "0", "throughput": "0Mi"},
19101910
},
19111911
diskType: "hyperdisk-balanced",
19121912
params: &common.DiskParameters{
@@ -1922,7 +1922,7 @@ func TestVolumeModifyOperation(t *testing.T) {
19221922
name: "Update volume with valid parameters but invalid disk type",
19231923
req: &csi.ControllerModifyVolumeRequest{
19241924
VolumeId: testVolumeID,
1925-
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
1925+
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
19261926
},
19271927
diskType: "pd-ssd",
19281928
params: &common.DiskParameters{
@@ -2053,7 +2053,7 @@ func TestVolumeModifyErrorHandling(t *testing.T) {
20532053
},
20542054
},
20552055
modifyReq: &csi.ControllerModifyVolumeRequest{
2056-
MutableParameters: map[string]string{"iops": "3001", "throughput": "151"},
2056+
MutableParameters: map[string]string{"iops": "3001", "throughput": "151Mi"},
20572057
},
20582058
modifyVolumeErrors: map[*meta.Key]error{
20592059
meta.ZonalKey(name, "us-central1-a"): &googleapi.Error{
@@ -2089,7 +2089,7 @@ func TestVolumeModifyErrorHandling(t *testing.T) {
20892089
},
20902090
},
20912091
modifyReq: &csi.ControllerModifyVolumeRequest{
2092-
MutableParameters: map[string]string{"iops": "10000", "throughput": "2400"},
2092+
MutableParameters: map[string]string{"iops": "10000", "throughput": "2400Mi"},
20932093
},
20942094
modifyVolumeErrors: map[*meta.Key]error{
20952095
meta.ZonalKey(name, "us-central1-a"): &googleapi.Error{Code: int(codes.InvalidArgument), Message: "InvalidArgument"},

Diff for: test/e2e/tests/single_zone_e2e_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@ var _ = Describe("GCE PD CSI Driver", func() {
16221622
stringPtr(provisionedIOPSOnCreateHdb),
16231623
stringPtr(provisionedThroughputOnCreateHdb),
16241624
stringPtr("3013"),
1625-
stringPtr("181"),
1625+
stringPtr("181Mi"),
16261626
),
16271627
Entry(
16281628
"for hyperdisk-extreme",
@@ -1640,7 +1640,7 @@ var _ = Describe("GCE PD CSI Driver", func() {
16401640
nil,
16411641
stringPtr(provisionedThroughputOnCreate),
16421642
nil,
1643-
stringPtr("70"),
1643+
stringPtr("70Mi"),
16441644
),
16451645
)
16461646
})

Diff for: test/k8s-integration/config/hdb-volumeattributesclass.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ metadata:
55
driverName: pd.csi.storage.gke.io
66
parameters:
77
iops: "3600"
8-
throughput: "290"
8+
throughput: "290Mi"

0 commit comments

Comments
 (0)