Skip to content

Commit

Permalink
core/oci: Ignore NotAnImage errors when deleting image
Browse files Browse the repository at this point in the history
If image doesn't exist, containers returns ErrNotAnImage, which is
expected when the image doesn't exist. This is the case when first
updating the system, for example.
  • Loading branch information
matbme committed Jun 7, 2023
1 parent 471c9f7 commit 6115ac0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"path/filepath"

"github.com/containers/buildah"
cstypes "github.com/containers/storage/types"
"github.com/vanilla-os/abroot/settings"
"github.com/vanilla-os/prometheus"
)
Expand Down Expand Up @@ -178,7 +179,7 @@ func DeleteImageForRoot(root string) error {
}

_, err = pt.Store.DeleteImage(image, true)
if err != nil {
if err != nil && err != cstypes.ErrNotAnImage {
PrintVerbose("DeleteImageForRoot:err(3): %s", err)
return err
}
Expand Down

0 comments on commit 6115ac0

Please sign in to comment.