From f4797370c27e6ce5eb0e8628339153d8c0d2ed92 Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Tue, 12 Sep 2023 15:50:18 +0200 Subject: [PATCH] openstack/api: delete image "container" when download fails if the image is failing to be ready in the given retry loop, we can delete the image "container" otherwise OpenStack will still try to download the image which will eventually will work but for nothing. Signed-off-by: Mathieu Tortuyaux --- platform/api/openstack/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/api/openstack/api.go b/platform/api/openstack/api.go index 9e6c69771..f7770a105 100644 --- a/platform/api/openstack/api.go +++ b/platform/api/openstack/api.go @@ -555,6 +555,7 @@ func (a *API) UploadImage(name, path string) (string, error) { return image.Status == images.ImageStatusActive, nil }); err != nil { + a.DeleteImage(image.ID) return "", fmt.Errorf("getting image active: %w", err) }