Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Wels <awels@redhat.com>
  • Loading branch information
awels committed Aug 3, 2023
1 parent f1d2ad2 commit 5c80162
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
17 changes: 5 additions & 12 deletions pkg/importer/http-datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,13 @@ func (hs *HTTPDataSource) Info() (ProcessingPhase, error) {
if hs.contentType == cdiv1.DataVolumeArchive {
return ProcessingPhaseTransferDataDir, nil
}
if hs.readers.Convert {
// 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 != "" {
if !hs.readers.Convert && (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 {
return ProcessingPhaseError, err
}
return ProcessingPhaseConvert, 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
}

// Transfer is called to transfer the data from the source to a scratch location.
Expand Down
5 changes: 0 additions & 5 deletions pkg/importer/http-datasource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ var _ = Describe("Http data source", func() {
if !wantErr {
Expect(err).NotTo(HaveOccurred())
Expect(expectedPhase).To(Equal(newPhase))
if newPhase == ProcessingPhaseConvert {
expectURL, err := url.Parse("nbd+unix:///?socket=/tmp/nbdkit.sock")
Expect(err).NotTo(HaveOccurred())
Expect(expectURL).To(Equal(dp.GetURL()))
}
} else {
Expect(err).To(HaveOccurred())
}
Expand Down
3 changes: 3 additions & 0 deletions tests/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ var _ = Describe("[rfe_id:1118][crit:high][vendor:cnv-qe@redhat.com][level:compo
afterCMD(portForwardCmd)
})

// Skipping this test until we can get progress information again. What happens is that the go
// http client cannot determine the total size, and thus the prometheus endpoint is not initialized
// This causes this test to now fail because the endpoint is not there, skipping for now.
PIt("[test_id:4970]Import pod should have prometheus stats available while importing", func() {
var endpoint *v1.Endpoints
c := f.K8sClient
Expand Down

0 comments on commit 5c80162

Please sign in to comment.