Skip to content

Commit 586740f

Browse files
committed
Support partitions in VolumeAttributes
1 parent a05409a commit 586740f

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
@@ -174,9 +174,12 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
174174
}
175175

176176
// Part 1: Get device path of attached device
177-
// TODO(#83): Get real partitions
178177
partition := ""
179178

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

0 commit comments

Comments
 (0)