[#207] Fix list parts with empty list #213

Merged
alexvanin merged 1 commit from mbiryukova/frostfs-s3-gw:bugfix/list_parts_empty_list into master 2023-09-21 14:48:14 +00:00
Member

Signed-off-by: Marina Biryukova m.biryukova@yadro.com

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2023-09-21 08:30:05 +00:00
mbiryukova added 1 commit 2023-09-21 08:30:07 +00:00
[#207] Fix list parts with empty list
All checks were successful
/ DCO (pull_request) Successful in 1m2s
/ Vulncheck (pull_request) Successful in 1m25s
/ Builds (1.20) (pull_request) Successful in 1m59s
/ Builds (1.21) (pull_request) Successful in 1m52s
/ Lint (pull_request) Successful in 8m23s
/ Tests (1.20) (pull_request) Successful in 2m1s
/ Tests (1.21) (pull_request) Successful in 9m26s
51e591877b
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova requested review from storage-services-committers 2023-09-21 09:00:37 +00:00
mbiryukova requested review from storage-services-developers 2023-09-21 09:00:38 +00:00
alexvanin approved these changes 2023-09-21 11:01:38 +00:00
dkirillov reviewed 2023-09-21 12:05:21 +00:00
@ -549,3 +549,3 @@
})
if p.PartNumberMarker >= parts[len(parts)-1].PartNumber {
if len(parts) == 0 || p.PartNumberMarker >= parts[len(parts)-1].PartNumber {
Member

Do we really need this? It seems without such condition we will get the same result below. Or am I missing something?

Do we really need this? It seems without such condition we will get the same result below. Or am I missing something?
Author
Member

Without this condition we will get panic here parts[len(parts)-1] if length of parts is 0

Without this condition we will get panic here `parts[len(parts)-1]` if length of parts is 0
Member

Oh, I see.

Oh, I see.
dkirillov marked this conversation as resolved
dkirillov approved these changes 2023-09-21 12:54:00 +00:00
alexvanin merged commit 51e591877b into master 2023-09-21 14:48:14 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-s3-gw#213
No description provided.