Skip to content

Commit 7087ed1

Browse files
authored
add umount to cleanup stack just if mount succeeded (#888)
1 parent 6dac7ff commit 7087ed1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/action/upgrade.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ func (u *UpgradeAction) Run() (err error) {
176176
umount, err = e.MountRWPartition(persistentPart)
177177
if err != nil {
178178
u.config.Logger.Warnf("could not mount persistent partition: %s", err.Error())
179+
} else {
180+
cleanup.Push(umount)
179181
}
180-
cleanup.Push(umount)
181182
}
182183
}
183184

0 commit comments

Comments
 (0)