mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Check nil volume on mount init
Fixes #10685 panic in some cases. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
f207dd5e7c
commit
7122b6643e
1 changed files with 4 additions and 3 deletions
|
@ -89,9 +89,10 @@ func (m *Mount) initialize() error {
|
|||
|
||||
// Make sure we remove these old volumes we don't actually want now.
|
||||
// Ignore any errors here since this is just cleanup, maybe someone volumes-from'd this volume
|
||||
v := m.container.daemon.volumes.Get(hostPath)
|
||||
v.RemoveContainer(m.container.ID)
|
||||
m.container.daemon.volumes.Delete(v.Path)
|
||||
if v := m.container.daemon.volumes.Get(hostPath); v != nil {
|
||||
v.RemoveContainer(m.container.ID)
|
||||
m.container.daemon.volumes.Delete(v.Path)
|
||||
}
|
||||
}
|
||||
|
||||
// This is the full path to container fs + mntToPath
|
||||
|
|
Loading…
Add table
Reference in a new issue