Skip to content

Commit d28ed59

Browse files
committed
Handle empty upload ID error instead of appending blank destination
1 parent 36fa594 commit d28ed59

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

pkg/controller/blob_to_chunk_controller.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -535,13 +535,7 @@ func (c *BlobToChunkController) buildChunk(blob *v1alpha1.Blob, name string, num
535535

536536
uploadID := uploadIDs[j]
537537
if uploadID == "" {
538-
chunk.Spec.Destination = append(chunk.Spec.Destination, v1alpha1.ChunkHTTP{
539-
Request: v1alpha1.ChunkHTTPRequest{
540-
Method: "",
541-
URL: "",
542-
},
543-
})
544-
continue
538+
return nil, fmt.Errorf("upload ID for destination %q is empty", dst.Name)
545539
}
546540

547541
mp := s3.GetMultipartWithUploadID(dst.Path, uploadID)
@@ -581,14 +575,6 @@ func (c *BlobToChunkController) toMultipart(ctx context.Context, blob *v1alpha1.
581575

582576
destinationNames = append(destinationNames, dst.Name)
583577

584-
if dst.SkipIfExists && blob.Status.Total > 0 {
585-
fi, err := s3.StatHead(ctx, dst.Path)
586-
if err == nil && fi.Size() == blob.Status.Total {
587-
uploadIDs = append(uploadIDs, "")
588-
continue
589-
}
590-
}
591-
592578
mp, err := s3.GetMultipart(ctx, dst.Path)
593579
if err != nil {
594580
mp, err = s3.NewMultipart(ctx, dst.Path)

0 commit comments

Comments
 (0)