diff --git a/pkg/importer/upload-datasource.go b/pkg/importer/upload-datasource.go index 643aa38b3f..c375b79455 100644 --- a/pkg/importer/upload-datasource.go +++ b/pkg/importer/upload-datasource.go @@ -51,10 +51,6 @@ func (ud *UploadDataSource) Info() (ProcessingPhase, error) { if ud.contentType == cdiv1.DataVolumeArchive { return ProcessingPhaseTransferDataDir, nil } - if !ud.readers.Convert { - // Uploading a raw file, we can write that directly to the target. - return ProcessingPhaseTransferDataFile, nil - } return ProcessingPhaseTransferScratch, nil } diff --git a/pkg/importer/upload-datasource_test.go b/pkg/importer/upload-datasource_test.go index bca95801e9..c9859fc9ea 100644 --- a/pkg/importer/upload-datasource_test.go +++ b/pkg/importer/upload-datasource_test.go @@ -78,7 +78,7 @@ var _ = Describe("Upload data source", func() { ud = NewUploadDataSource(file, dvKubevirt) result, err := ud.Info() Expect(err).NotTo(HaveOccurred()) - Expect(ProcessingPhaseTransferDataFile).To(Equal(result)) + Expect(ProcessingPhaseTransferScratch).To(Equal(result)) }) DescribeTable("calling transfer should", func(fileName string, dvContentType cdiv1.DataVolumeContentType, expectedPhase ProcessingPhase, scratchPath string, want []byte, wantErr bool) { @@ -136,7 +136,7 @@ var _ = Describe("Upload data source", func() { ud = NewUploadDataSource(sourceFile, dvKubevirt) result, err := ud.Info() Expect(err).NotTo(HaveOccurred()) - Expect(ProcessingPhaseTransferDataFile).To(Equal(result)) + Expect(ProcessingPhaseTransferScratch).To(Equal(result)) result, err = ud.TransferFile(filepath.Join(tmpDir, "file")) Expect(err).ToNot(HaveOccurred()) Expect(ProcessingPhaseResize).To(Equal(result)) @@ -149,7 +149,7 @@ var _ = Describe("Upload data source", func() { ud = NewUploadDataSource(sourceFile, dvKubevirt) result, err := ud.Info() Expect(err).NotTo(HaveOccurred()) - Expect(ProcessingPhaseTransferDataFile).To(Equal(result)) + Expect(ProcessingPhaseTransferScratch).To(Equal(result)) result, err = ud.TransferFile("/invalidpath/invalidfile") Expect(err).To(HaveOccurred()) Expect(ProcessingPhaseError).To(Equal(result)) @@ -211,7 +211,7 @@ var _ = Describe("Async Upload data source", func() { aud = NewAsyncUploadDataSource(file) result, err := aud.Info() Expect(err).NotTo(HaveOccurred()) - Expect(ProcessingPhaseTransferDataFile).To(Equal(result)) + Expect(ProcessingPhaseTransferScratch).To(Equal(result)) }) DescribeTable("calling transfer should", func(fileName, scratchPath string, want []byte, wantErr bool) { @@ -260,7 +260,7 @@ var _ = Describe("Async Upload data source", func() { aud = NewAsyncUploadDataSource(sourceFile) result, err := aud.Info() Expect(err).NotTo(HaveOccurred()) - Expect(ProcessingPhaseTransferDataFile).To(Equal(result)) + Expect(ProcessingPhaseTransferScratch).To(Equal(result)) result, err = aud.TransferFile(filepath.Join(tmpDir, "file")) Expect(err).ToNot(HaveOccurred()) Expect(ProcessingPhaseValidatePause).To(Equal(result)) @@ -274,7 +274,7 @@ var _ = Describe("Async Upload data source", func() { aud = NewAsyncUploadDataSource(sourceFile) result, err := aud.Info() Expect(err).NotTo(HaveOccurred()) - Expect(ProcessingPhaseTransferDataFile).To(Equal(result)) + Expect(ProcessingPhaseTransferScratch).To(Equal(result)) result, err = aud.TransferFile("/invalidpath/invalidfile") Expect(err).To(HaveOccurred()) Expect(ProcessingPhaseError).To(Equal(result))