Skip to content

Commit

Permalink
Fixed Duplicate Client-token issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mskanth972 committed Aug 5, 2024
1 parent 2c80cae commit 2ed7ce9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
return nil, status.Error(codes.InvalidArgument, "Invalid value for reuseAccessPoint parameter")
}
if reuseAccessPoint {
clientToken = get64LenHash(volumeParams[PvcNameKey])
clientToken = get64LenHash(volumeParams[PvcNameKey] + volumeParams[FsId])
klog.V(5).Infof("Client token : %s", clientToken)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/driver/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ func TestCreateVolume(t *testing.T) {
Uid: 1000,
},
}
mockCloud.EXPECT().FindAccessPointByClientToken(gomock.Eq(ctx), gomock.Any(), gomock.Eq(fsId)).Return(accessPoint, nil)
mockCloud.EXPECT().FindAccessPointByClientToken(gomock.Eq(ctx), gomock.Eq(get64LenHash(pvcNameVal+fsId)), gomock.Eq(fsId)).Return(accessPoint, nil)

res, err := driver.CreateVolume(ctx, req)

Expand Down

0 comments on commit 2ed7ce9

Please sign in to comment.