Skip to content

Commit cebcb23

Browse files
committed
add per-alloc renaming at client
1 parent 1d92b17 commit cebcb23

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

client/allocrunner/csi_hook.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,13 @@ func (c *csiHook) Postrun() error {
9292
mode = structs.CSIVolumeClaimWrite
9393
}
9494

95+
source := pair.request.Source
96+
if pair.request.PerAlloc {
97+
source = source + structs.AllocSuffix(c.alloc.Name)
98+
}
99+
95100
req := &structs.CSIVolumeUnpublishRequest{
96-
VolumeID: pair.request.Source,
101+
VolumeID: source,
97102
Claim: &structs.CSIVolumeClaim{
98103
AllocationID: c.alloc.ID,
99104
NodeID: c.alloc.NodeID,
@@ -159,8 +164,13 @@ func (c *csiHook) claimVolumesFromAlloc() (map[string]*volumeAndRequest, error)
159164
claimType = structs.CSIVolumeClaimRead
160165
}
161166

167+
source := pair.request.Source
168+
if pair.request.PerAlloc {
169+
source = source + structs.AllocSuffix(c.alloc.Name)
170+
}
171+
162172
req := &structs.CSIVolumeClaimRequest{
163-
VolumeID: pair.request.Source,
173+
VolumeID: source,
164174
AllocationID: c.alloc.ID,
165175
NodeID: c.alloc.NodeID,
166176
Claim: claimType,

0 commit comments

Comments
 (0)