summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/tunnel/containers.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-02-16 07:01:14 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-02-16 09:47:38 -0500
commit958f90143199bbc4b5dcd7ad4fffdd56d3f6fbc3 (patch)
tree4eaaf18c511d9e3e05a58ca47039333bd4c86ee3 /pkg/domain/infra/tunnel/containers.go
parent58a4793bec30058f648dcd1248da333a7bb6d47c (diff)
downloadpodman-958f90143199bbc4b5dcd7ad4fffdd56d3f6fbc3.tar.gz
podman-958f90143199bbc4b5dcd7ad4fffdd56d3f6fbc3.tar.bz2
podman-958f90143199bbc4b5dcd7ad4fffdd56d3f6fbc3.zip
podman kill should report rawInput not container id
Docker always reports back the users input, not the full id, we should do the same. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel/containers.go')
-rw-r--r--pkg/domain/infra/tunnel/containers.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go
index 5a83faaf0..b0a07cd27 100644
--- a/pkg/domain/infra/tunnel/containers.go
+++ b/pkg/domain/infra/tunnel/containers.go
@@ -124,16 +124,21 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
}
func (ic *ContainerEngine) ContainerKill(ctx context.Context, namesOrIds []string, opts entities.KillOptions) ([]*entities.KillReport, error) {
- ctrs, err := getContainersByContext(ic.ClientCtx, opts.All, false, namesOrIds)
+ ctrs, rawInputs, err := getContainersAndInputByContext(ic.ClientCtx, opts.All, false, namesOrIds)
if err != nil {
return nil, err
}
+ ctrMap := map[string]string{}
+ for i := range ctrs {
+ ctrMap[ctrs[i].ID] = rawInputs[i]
+ }
options := new(containers.KillOptions).WithSignal(opts.Signal)
reports := make([]*entities.KillReport, 0, len(ctrs))
for _, c := range ctrs {
reports = append(reports, &entities.KillReport{
- Id: c.ID,
- Err: containers.Kill(ic.ClientCtx, c.ID, options),
+ Id: c.ID,
+ Err: containers.Kill(ic.ClientCtx, c.ID, options),
+ RawInput: ctrMap[c.ID],
})
}
return reports, nil