Skip to content

Commit

Permalink
Fix uploading for block devices that exceed requested size
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
  • Loading branch information
kvaps committed Oct 14, 2024
1 parent 7b330eb commit 15d8a4e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/importer/data-processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ func (dp *DataProcessor) calculateTargetSize() int64 {
klog.V(1).Infof("Request image size not empty.\n")
newImageSizeQuantity := resource.MustParse(dp.requestImageSize)
minQuantity := util.MinQuantity(targetQuantity, &newImageSizeQuantity)
targetQuantity = &minQuantity
if targetQuantity.Cmp(minQuantity) == -1 {
targetQuantity = &minQuantity
}
}
klog.V(1).Infof("Target size %s.\n", targetQuantity.String())
targetSize := targetQuantity.Value()
Expand Down

0 comments on commit 15d8a4e

Please sign in to comment.