Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
mounts: Fix bug while checking if /dev was bind-mounted
Browse files Browse the repository at this point in the history
There was a bug in the way we were checking if /dev was
bindmounted from the host.

Signed-off-by: Archana Shinde <[email protected]>
  • Loading branch information
amshinde committed Jan 4, 2018
1 parent 78e617b commit de86549
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,13 @@ func (c *Container) fetchState(cmd string) (State, error) {

func (c *Container) getSystemMountInfo() {
// check if /dev needs to be bind mounted from host /dev
c.systemMountsInfo.BindMountDev = false

for _, m := range c.mounts {
if m.Source == "/dev" && m.Destination == "/dev" && m.Type == "bind" {
c.systemMountsInfo.BindMountDev = true
} else {
c.systemMountsInfo.BindMountDev = false
if m.Destination == "/dev" {
if m.Source == "/dev" && m.Type == "bind" {
c.systemMountsInfo.BindMountDev = true
}
}
}

Expand Down

0 comments on commit de86549

Please sign in to comment.