Skip to content

Commit

Permalink
openstack/api: delete image "container" when download fails
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tormath1 committed Sep 12, 2023
1 parent a30be60 commit f479737
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions platform/api/openstack/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit f479737

Please sign in to comment.