Skip to content

Commit

Permalink
When converting always use scratch space importing instead
Browse files Browse the repository at this point in the history
of ndbkit. Once we are able to get nbdkit 1.35.8 or newer
we can revert this change since that will include improvements
to the downloading speed.

Signed-off-by: Alexander Wels <awels@redhat.com>
  • Loading branch information
awels committed Aug 1, 2023
1 parent 43e5ed8 commit 511e405
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions pkg/importer/http-datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ func (hs *HTTPDataSource) Info() (ProcessingPhase, error) {
return ProcessingPhaseTransferDataDir, nil
}
if hs.readers.Convert {
if hs.brokenForQemuImg || hs.readers.Archived || hs.customCA != "" {
return ProcessingPhaseTransferScratch, nil
}
} else {
if hs.readers.Archived || hs.customCA != "" {
return ProcessingPhaseTransferDataFile, nil
}
// removing check for hs.brokenForQemuImg, and always assuming it is true
// revert once we are able to get nbdkit 1.35.8, which contains a fix for the
// slow download speed.
return ProcessingPhaseTransferScratch, nil
}
if hs.readers.Archived || hs.customCA != "" {
return ProcessingPhaseTransferDataFile, nil
}
hs.url, _ = url.Parse(fmt.Sprintf("nbd+unix:///?socket=%s", nbdkitSocket))
if err = hs.n.StartNbdkit(hs.endpoint.String()); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/importer/http-datasource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ var _ = Describe("Http data source", func() {
Expect(err).To(HaveOccurred())
}
},
Entry("return Convert phase ", cirrosFileName, cdiv1.DataVolumeKubeVirt, ProcessingPhaseConvert, cirrosData, false),
Entry("return TransferScratch phase ", cirrosFileName, cdiv1.DataVolumeKubeVirt, ProcessingPhaseTransferScratch, cirrosData, false),
Entry("return TransferTarget with archive content type but not archive endpoint ", cirrosFileName, cdiv1.DataVolumeArchive, ProcessingPhaseTransferDataDir, cirrosData, false),
Entry("return TransferTarget with archive content type and archive endpoint ", diskimageTarFileName, cdiv1.DataVolumeArchive, ProcessingPhaseTransferDataDir, diskimageArchiveData, false),
)
Expand Down

0 comments on commit 511e405

Please sign in to comment.