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 <bbaude@redhat.com>
This commit is contained in:
Brent Baude 2020-01-30 13:21:40 -06:00
parent ee0b328b72
commit 616acf181d
1 changed files with 2 additions and 2 deletions

View File

@ -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",