Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into multi-witer
Browse files Browse the repository at this point in the history
  • Loading branch information
karkunpavan committed Nov 14, 2024
2 parents 8081b51 + 66899b6 commit 35d3d55
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ metadata:
imageTag:
name: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
newName: gcr.io/k8s-staging-cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
newTag: "v1.15.2-rc2"
newTag: "v1.15.2-rc3"
---

7 changes: 7 additions & 0 deletions deploy/kubernetes/overlays/dev/driver-args.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- op: add
path: /spec/template/spec/containers/0/args/-
value: --supports-dynamic-throughput-provisioning=hyperdisk-balanced,hyperdisk-throughput,hyperdisk-ml

- op: add
path: /spec/template/spec/containers/0/args/-
value: --supports-dynamic-iops-provisioning=hyperdisk-balanced,hyperdisk-extreme
8 changes: 8 additions & 0 deletions deploy/kubernetes/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ resources:
# Here dev overlay is using the same image as alpha
transformers:
- ../../images/stable-master
# Apply patches to support dynamic provisioning for hyperdisks
patches:
- path: ./driver-args.yaml
target:
group: apps
version: v1
kind: Deployment
name: csi-gce-pd-controller
# To change the dev image, add something like the following.
#images:
#- name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
Expand Down
4 changes: 2 additions & 2 deletions examples/kubernetes/demo-vol-create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
driverName: pd.csi.storage.gke.io
parameters:
iops: "3000"
throughput: "150Mi"
throughput: "150"
---
apiVersion: storage.k8s.io/v1beta1
kind: VolumeAttributesClass
Expand All @@ -25,7 +25,7 @@ metadata:
driverName: pd.csi.storage.gke.io
parameters:
iops: "3013"
throughput: "151Mi"
throughput: "151"
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func ExtractModifyVolumeParameters(parameters map[string]string) (ModifyVolumePa
}
modifyVolumeParams.IOPS = &iops
case "throughput":
throughput, err := ConvertMiStringToInt64(value)
throughput, err := ConvertStringToInt64(value)
if err != nil {
return ModifyVolumeParameters{}, fmt.Errorf("parameters contain invalid throughput parameter: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/parameters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ func TestSnapshotParameters(t *testing.T) {
func TestExtractModifyVolumeParameters(t *testing.T) {
parameters := map[string]string{
"iops": "1000",
"throughput": "500Mi",
"throughput": "500",
}

iops := int64(1000)
Expand Down
14 changes: 7 additions & 7 deletions pkg/gce-pd-csi-driver/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ func TestCreateVolumeWithVolumeAttributeClassParameters(t *testing.T) {
},
},
},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
},
expIops: 20000,
expThroughput: 600,
Expand Down Expand Up @@ -1822,7 +1822,7 @@ func TestCreateVolumeWithVolumeAttributeClassParameters(t *testing.T) {
},
},
},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
},
expIops: 0,
expThroughput: 0,
Expand Down Expand Up @@ -1890,7 +1890,7 @@ func TestVolumeModifyOperation(t *testing.T) {
name: "Update volume with valid parameters",
req: &csi.ControllerModifyVolumeRequest{
VolumeId: testVolumeID,
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
},
diskType: "hyperdisk-balanced",
params: &common.DiskParameters{
Expand All @@ -1906,7 +1906,7 @@ func TestVolumeModifyOperation(t *testing.T) {
name: "Update volume with invalid parameters",
req: &csi.ControllerModifyVolumeRequest{
VolumeId: testVolumeID,
MutableParameters: map[string]string{"iops": "0", "throughput": "0Mi"},
MutableParameters: map[string]string{"iops": "0", "throughput": "0"},
},
diskType: "hyperdisk-balanced",
params: &common.DiskParameters{
Expand All @@ -1922,7 +1922,7 @@ func TestVolumeModifyOperation(t *testing.T) {
name: "Update volume with valid parameters but invalid disk type",
req: &csi.ControllerModifyVolumeRequest{
VolumeId: testVolumeID,
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
},
diskType: "pd-ssd",
params: &common.DiskParameters{
Expand Down Expand Up @@ -2053,7 +2053,7 @@ func TestVolumeModifyErrorHandling(t *testing.T) {
},
},
modifyReq: &csi.ControllerModifyVolumeRequest{
MutableParameters: map[string]string{"iops": "3001", "throughput": "151Mi"},
MutableParameters: map[string]string{"iops": "3001", "throughput": "151"},
},
modifyVolumeErrors: map[*meta.Key]error{
meta.ZonalKey(name, "us-central1-a"): &googleapi.Error{
Expand Down Expand Up @@ -2089,7 +2089,7 @@ func TestVolumeModifyErrorHandling(t *testing.T) {
},
},
modifyReq: &csi.ControllerModifyVolumeRequest{
MutableParameters: map[string]string{"iops": "10000", "throughput": "2400Mi"},
MutableParameters: map[string]string{"iops": "10000", "throughput": "2400"},
},
modifyVolumeErrors: map[*meta.Key]error{
meta.ZonalKey(name, "us-central1-a"): &googleapi.Error{Code: int(codes.InvalidArgument), Message: "InvalidArgument"},
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/tests/single_zone_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ var _ = Describe("GCE PD CSI Driver", func() {
stringPtr(provisionedIOPSOnCreateHdb),
stringPtr(provisionedThroughputOnCreateHdb),
stringPtr("3013"),
stringPtr("181Mi"),
stringPtr("181"),
),
Entry(
"for hyperdisk-extreme",
Expand All @@ -1640,7 +1640,7 @@ var _ = Describe("GCE PD CSI Driver", func() {
nil,
stringPtr(provisionedThroughputOnCreate),
nil,
stringPtr("70Mi"),
stringPtr("70"),
),
)
})
Expand Down
2 changes: 1 addition & 1 deletion test/k8s-integration/config/hdb-volumeattributesclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
driverName: pd.csi.storage.gke.io
parameters:
iops: "3600"
throughput: "290Mi"
throughput: "290"

0 comments on commit 35d3d55

Please sign in to comment.