Skip to content

Commit

Permalink
EnsureImage download image fix
Browse files Browse the repository at this point in the history
Signed-off-by: muhammad adil ghaffar <[email protected]>
  • Loading branch information
adilGhaffarDev committed Feb 29, 2024
1 parent f5e3751 commit d6b9d10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
ipamv1 "github.com/metal3-io/ip-address-manager/api/v1alpha1"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/pkg/errors"
"golang.org/x/crypto/ssh"
corev1 "k8s.io/api/core/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Expand Down Expand Up @@ -181,6 +182,9 @@ func DownloadFile(filePath string, url string) error {
if err != nil {
return err
}
if resp.StatusCode != http.StatusOK {
return errors.Errorf("failed to download image from %s got %d", filePath, resp.StatusCode)
}
defer resp.Body.Close()

// Create the file
Expand Down

0 comments on commit d6b9d10

Please sign in to comment.