Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/driver/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ func (cs *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolume
"starting token out of bounds: %q", startingToken)
}
listOpts.Page = int(startingPage)
nextToken = strconv.Itoa(listOpts.Page + 1)
}

// List all volumes
Expand All @@ -387,6 +386,11 @@ func (cs *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolume
})
}

// Only set nextToken if we got a full page and there might be more
if req.GetMaxEntries() > 0 && len(volumes) >= listOpts.PageSize {
nextToken = strconv.Itoa(listOpts.Page + 1)
}

resp := &csi.ListVolumesResponse{
Entries: entries,
NextToken: nextToken,
Expand Down
Loading