Skip to content

Commit

Permalink
fix: Avoid deleting newly created image
Browse files Browse the repository at this point in the history
  • Loading branch information
matbme committed Jan 5, 2024
1 parent 2966ec0 commit 9acbbc4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions core/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,17 @@ func (s *ABSystem) RunOperation(operation ABSystemOperation) error {
labels["ABRoot.BaseImageDigest"] = imageDigest
}

// Stage 3.1: Delete old image
switch operation {
case DRY_RUN_UPGRADE, DRY_RUN_APPLY, DRY_RUN_INITRAMFS:
default:
err = DeleteImageForRoot(futurePartition.Label)
if err != nil {
PrintVerboseErr("ABSystemRunOperation", 3.4, err)
return err
}
}

imageRecipe := NewImageRecipe(
imageName,
labels,
Expand Down Expand Up @@ -803,13 +814,6 @@ func (s *ABSystem) RunOperation(operation ABSystemOperation) error {
return nil
}

// Stage 6.3: Delete old image
err = DeleteImageForRoot(futurePartition.Label)
if err != nil {
PrintVerboseErr("ABSystemRunOperation", 6.3, err)
return err
}

// Stage 7: Update the bootloader
// ------------------------------------------------
PrintVerboseSimple("[Stage 7] -------- ABSystemRunOperation")
Expand Down

0 comments on commit 9acbbc4

Please sign in to comment.