diff --git a/hack/build/docker/cdi-func-test-file-host-init/Dockerfile b/hack/build/docker/cdi-func-test-file-host-init/Dockerfile index ad7d7a746c..1db970a404 100644 --- a/hack/build/docker/cdi-func-test-file-host-init/Dockerfile +++ b/hack/build/docker/cdi-func-test-file-host-init/Dockerfile @@ -2,7 +2,7 @@ FROM fedora:28 RUN mkdir -p /tmp/shared /tmp/source -RUN yum install -y qemu-img +RUN yum install -y qemu-img qemu-block-curl && dnf clean all COPY cdi-func-test-file-host-init /usr/bin/ diff --git a/pkg/importer/dataStream.go b/pkg/importer/dataStream.go index 2d254ba426..8478baf18c 100644 --- a/pkg/importer/dataStream.go +++ b/pkg/importer/dataStream.go @@ -519,7 +519,11 @@ func closeReaders(readers []reader) (rtnerr error) { } func (d *DataStream) isHTTPQcow2() bool { - return (d.url.Scheme == "http" || d.url.Scheme == "https") && d.qemu && len(d.Readers) == 2 + return (d.url.Scheme == "http" || d.url.Scheme == "https") && + d.accessKeyID == "" && + d.secretKey == "" && + d.qemu && + len(d.Readers) == 2 } // Copy endpoint to dest based on passed-in reader. diff --git a/tests/transport_test.go b/tests/transport_test.go index 2c371c94e0..211ee37cf2 100644 --- a/tests/transport_test.go +++ b/tests/transport_test.go @@ -19,8 +19,9 @@ import ( var _ = Describe("Transport Tests", func() { const ( - secretPrefix = "transport-e2e-sec" - targetFile = "tinyCore.iso" + secretPrefix = "transport-e2e-sec" + targetFile = "tinyCore.iso" + targetQCOWFile = "tinyCore.qcow2" ) f, err := framework.NewFramework("", framework.Config{SkipNamespaceCreation: false}) @@ -37,7 +38,9 @@ var _ = Describe("Transport Tests", func() { handelError(err) httpAuthEp := fmt.Sprintf("http://%s:%d/%s", fileHostService.Spec.ClusterIP, httoAuthPort, targetFile) + httpAuthQCOWEp := fmt.Sprintf("http://%s:%d/%s", fileHostService.Spec.ClusterIP, httoAuthPort, targetQCOWFile) httpNoAuthEp := fmt.Sprintf("http://%s:%d/%s", fileHostService.Spec.ClusterIP, noAuthPort, targetFile) + httpNoAuthQCOWEp := fmt.Sprintf("http://%s:%d/%s", fileHostService.Spec.ClusterIP, noAuthPort, targetQCOWFile) var ns string BeforeEach(func() { @@ -84,7 +87,9 @@ var _ = Describe("Transport Tests", func() { DescribeTable("Transport Test Table", it, Entry("should connect to http endpoint without credentials", httpNoAuthEp, false), - Entry("should connect to http endpoint with credentials", httpAuthEp, true)) + Entry("should connect to http endpoint with credentials", httpAuthEp, true), + Entry("should connect to QCOW http endpoint without credentials", httpNoAuthQCOWEp, false), + Entry("should connect to QCOW http endpoint with credentials", httpAuthQCOWEp, true)) }) // handelError is intended for use outside It(), BeforeEach() and AfterEach() blocks where Expect() cannot be called.