Skip to content

Commit

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

0 comments on commit 5f66979

Please sign in to comment.