Skip to content

Commit

Permalink
add per-alloc renaming at client
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Mar 10, 2021
1 parent 1d92b17 commit cebcb23
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions client/allocrunner/csi_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ func (c *csiHook) Postrun() error {
mode = structs.CSIVolumeClaimWrite
}

source := pair.request.Source
if pair.request.PerAlloc {
source = source + structs.AllocSuffix(c.alloc.Name)
}

req := &structs.CSIVolumeUnpublishRequest{
VolumeID: pair.request.Source,
VolumeID: source,
Claim: &structs.CSIVolumeClaim{
AllocationID: c.alloc.ID,
NodeID: c.alloc.NodeID,
Expand Down Expand Up @@ -159,8 +164,13 @@ func (c *csiHook) claimVolumesFromAlloc() (map[string]*volumeAndRequest, error)
claimType = structs.CSIVolumeClaimRead
}

source := pair.request.Source
if pair.request.PerAlloc {
source = source + structs.AllocSuffix(c.alloc.Name)
}

req := &structs.CSIVolumeClaimRequest{
VolumeID: pair.request.Source,
VolumeID: source,
AllocationID: c.alloc.ID,
NodeID: c.alloc.NodeID,
Claim: claimType,
Expand Down

0 comments on commit cebcb23

Please sign in to comment.