Skip to content

Commit 66cd01f

Browse files
authored
Merge pull request #123 from davidz627/feature/partitionAttributes
Support partitions in VolumeAttributes
2 parents bde0d25 + 586740f commit 66cd01f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pkg/common/constants.go

+3
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ const (
2323

2424
// Keys for Topology. This key will be shared amonst drivers from GCP
2525
TopologyKeyZone = "com.google.topology/zone"
26+
27+
// VolumeAttributes for Partition
28+
VolumeAttributePartition = "partition"
2629
)

pkg/gce-pd-csi-driver/node.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,12 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
173173
}
174174

175175
// Part 1: Get device path of attached device
176-
// TODO(#83): Get real partitions
177176
partition := ""
178177

178+
if part, ok := req.GetVolumeAttributes()[common.VolumeAttributePartition]; ok {
179+
partition = part
180+
}
181+
179182
deviceName, err := common.GetDeviceName(volumeKey)
180183
if err != nil {
181184
status.Error(codes.Internal, fmt.Sprintf("error getting device name: %v", err))

0 commit comments

Comments
 (0)