Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2127 from devimc/topic/virtcontainers/rollbackUnm…
Browse files Browse the repository at this point in the history
…ountHostMounts

virtcontainers: unmount host mounts if container can't be created
  • Loading branch information
bergwolf authored Oct 14, 2019
2 parents a1cd0f8 + eca7bd2 commit 7d484df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions virtcontainers/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,12 @@ func (c *Container) rollbackFailingContainerCreation() {
if err := c.removeDrive(); err != nil {
c.Logger().WithError(err).Error("rollback failed removeDrive()")
}
if err := c.unmountHostMounts(); err != nil {
c.Logger().WithError(err).Error("rollback failed unmountHostMounts()")
}
if err := bindUnmountContainerRootfs(c.ctx, kataHostSharedDir(), c.sandbox.id, c.id); err != nil {
c.Logger().WithError(err).Error("rollback failed bindUnmountContainerRootfs()")
}
}

func (c *Container) checkBlockDeviceSupport() bool {
Expand Down

0 comments on commit 7d484df

Please sign in to comment.