From 0477d61856d01c7164a2fb692afa2a18e27244e0 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Wed, 16 Mar 2016 13:26:15 -0700 Subject: [PATCH] Fix inspect to print bind mounts source path instead of an empty string Signed-off-by: Kenfe-Mickael Laventure Upstream-commit: cb8cc56c225cfc74b81f22a0f2ca8ce7bdccfe04 Component: engine --- components/engine/api/client/formatter/custom.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/engine/api/client/formatter/custom.go b/components/engine/api/client/formatter/custom.go index 9ac457a414..2bb26a3dbe 100644 --- a/components/engine/api/client/formatter/custom.go +++ b/components/engine/api/client/formatter/custom.go @@ -146,9 +146,14 @@ func (c *containerContext) Label(name string) string { func (c *containerContext) Mounts() string { c.addHeader(mountsHeader) + var name string var mounts []string for _, m := range c.c.Mounts { - name := m.Name + if m.Name == "" { + name = m.Source + } else { + name = m.Name + } if c.trunc { name = stringutils.Truncate(name, 15) }