From 616acf181d5df87f685b00fa5d03ab7d4e266abc Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Thu, 30 Jan 2020 13:21:40 -0600 Subject: compat container names begin with / when using the apiv2, containers names are preceeded with a /. fixing this for inspect and listcontainers. Signed-off-by: Brent Baude --- pkg/api/handlers/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go index 33cf1e95d..9c8562744 100644 --- a/pkg/api/handlers/types.go +++ b/pkg/api/handlers/types.go @@ -360,7 +360,7 @@ func LibpodToContainer(l *libpod.Container, infoData []define.InfoData) (*Contai return &Container{docker.Container{ ID: l.ID(), - Names: []string{l.Name()}, + Names: []string{fmt.Sprintf("/%s", l.Name())}, Image: imageName, ImageID: imageId, Command: strings.Join(l.Command(), " "), @@ -431,7 +431,7 @@ func LibpodToContainerJSON(l *libpod.Container) (*docker.ContainerJSON, error) { HostsPath: inspect.HostsPath, LogPath: l.LogPath(), Node: nil, - Name: l.Name(), + Name: fmt.Sprintf("/%s", l.Name()), RestartCount: 0, Driver: inspect.Driver, Platform: "linux", -- cgit v1.2.3-54-g00ecf