Skip to content

Commit 7e62b8b

Browse files
committed
Added acadia block support with bandwidth support in volume
Signed-off-by: Arashad Ahamad <[email protected]>
1 parent a1a6dbc commit 7e62b8b

File tree

8 files changed

+44
-6
lines changed

8 files changed

+44
-6
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: storage.k8s.io/v1
2+
kind: StorageClass
3+
metadata:
4+
name: ibmc-vpc-block-sdp
5+
provisioner: vpc.block.csi.ibm.io
6+
parameters:
7+
profile: "sdp"
8+
iops: "100"
9+
bandwidth: "1000"
10+
csi.storage.k8s.io/fstype: "ext4"
11+
billingType: "hourly"
12+
encrypted: "false"
13+
encryptionKey: ""
14+
resourceGroup: ""
15+
zone: ""
16+
tags: ""
17+
generation: "gc"
18+
classVersion: "1"
19+
reclaimPolicy: "Delete"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.22.0
44

55
require (
66
github.com/IBM/ibm-csi-common v1.1.18
7-
github.com/IBM/ibmcloud-volume-interface v1.2.9
7+
github.com/IBM/ibmcloud-volume-interface v1.2.11
88
github.com/IBM/ibmcloud-volume-vpc v1.1.15
99
github.com/IBM/secret-utils-lib v1.1.12
1010
github.com/container-storage-interface/spec v1.9.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ github.com/IBM/go-sdk-core/v5 v5.17.4 h1:VGb9+mRrnS2HpHZFM5hy4J6ppIWnwNrw0G+tLSg
88
github.com/IBM/go-sdk-core/v5 v5.17.4/go.mod h1:KsAAI7eStAWwQa4F96MLy+whYSh39JzNjklZRbN/8ns=
99
github.com/IBM/ibm-csi-common v1.1.18 h1:CbzoONFN6vdmPLoXGxygiq3sbr2xtAcVUb0Vqj3/HNI=
1010
github.com/IBM/ibm-csi-common v1.1.18/go.mod h1:bDs9CLfr09kFpSMcR35e9AmyR2pSydx8goHjagFPrHs=
11-
github.com/IBM/ibmcloud-volume-interface v1.2.9 h1:ug55V2mzK/IaFkfuKDOt74yzhLapSR/+qVgfQblfAjw=
12-
github.com/IBM/ibmcloud-volume-interface v1.2.9/go.mod h1:sDeQiPuN8k9yTRl9FbE2GZCXPNg4cV3oldUfL8wwGNA=
11+
github.com/IBM/ibmcloud-volume-interface v1.2.11 h1:6WfsSwfkLJggxlh2j7FDGU3hkZO8fsKzb54w5KHrvzA=
12+
github.com/IBM/ibmcloud-volume-interface v1.2.11/go.mod h1:sDeQiPuN8k9yTRl9FbE2GZCXPNg4cV3oldUfL8wwGNA=
1313
github.com/IBM/ibmcloud-volume-vpc v1.1.15 h1:0TsFcTX8Enbma+gq3Lp9dNqB0NzlzGw+SR4hvPJsXMQ=
1414
github.com/IBM/ibmcloud-volume-vpc v1.1.15/go.mod h1:CSAsBgEXN6WL8y/EpEj9GA+w+vs3fVLoRadtuCWUAz8=
1515
github.com/IBM/secret-common-lib v1.1.11 h1:EpfEe1gT1bnFQ3bxQPrh6bzTPeGjUo1NReVkCCP+TOc=

pkg/ibmcsidriver/constants.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ const (
128128

129129
// MinimumSDPVolumeSizeInBytes ... This is minimum size require for sdp (acadia profile)
130130
MinimumSDPVolumeSizeInBytes int64 = 1 * utils.GiB
131+
132+
// Bandwidth ...
133+
Bandwidth = "bandwidth"
131134
)
132135

133136
// SupportedFS the supported FS types

pkg/ibmcsidriver/controller_helper.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,15 @@ func getVolumeParameters(logger *zap.Logger, req *csi.CreateVolumeRequest, confi
168168
iops := value
169169
volume.Iops = &iops
170170
}
171-
171+
case Bandwidth: // getting bandwidth value from storage class if it is provided
172+
if len(value) != 0 {
173+
bandwidth, err := strconv.ParseInt(value, 10, 32)
174+
if err != nil {
175+
err = fmt.Errorf("'<%v>' is invalid, value of '%s' should be an int32 type", value, key)
176+
} else {
177+
volume.Bandwidth = int32(bandwidth)
178+
}
179+
}
172180
default:
173181
err = fmt.Errorf("<%s> is an invalid parameter", key)
174182
}

vendor/github.com/IBM/ibmcloud-volume-interface/lib/provider/vpc_data_types.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/IBM/ibmcloud-volume-interface/lib/utils/messages.go

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ github.com/IBM/ibm-csi-common/pkg/metadata/fake
1616
github.com/IBM/ibm-csi-common/pkg/metrics
1717
github.com/IBM/ibm-csi-common/pkg/mountmanager
1818
github.com/IBM/ibm-csi-common/pkg/utils
19-
# github.com/IBM/ibmcloud-volume-interface v1.2.9
19+
# github.com/IBM/ibmcloud-volume-interface v1.2.11
2020
## explicit; go 1.22.0
2121
github.com/IBM/ibmcloud-volume-interface/config
2222
github.com/IBM/ibmcloud-volume-interface/lib/metrics

0 commit comments

Comments
 (0)