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 Oct 25, 2023
1 parent 36efeff commit 2f1d1cb
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 @@ -92,7 +92,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 @@ -787,7 +787,7 @@ func TestCreateVolume(t *testing.T) {
accessPoints := []*cloud.AccessPoint{accessPoint}
mockCloud.EXPECT().DescribeFileSystem(gomock.Eq(ctx), gomock.Any()).Return(fileSystem, nil)
mockCloud.EXPECT().ListAccessPoints(gomock.Eq(ctx), gomock.Any()).Return(accessPoints, nil)
mockCloud.EXPECT().CreateAccessPoint(gomock.Eq(ctx), gomock.Eq(get64LenHash(pvcNameVal)), gomock.Any(), gomock.Any()).Return(accessPoint, nil)
mockCloud.EXPECT().CreateAccessPoint(gomock.Eq(ctx), gomock.Eq(get64LenHash(pvcNameVal+fsId)), gomock.Any(), gomock.Any()).Return(accessPoint, nil)

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

Expand Down

0 comments on commit 2f1d1cb

Please sign in to comment.