From 958f90143199bbc4b5dcd7ad4fffdd56d3f6fbc3 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 16 Feb 2021 07:01:14 -0500 Subject: 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 --- pkg/domain/infra/abi/containers.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'pkg/domain/infra/abi') diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index 9bef97a5c..0ee4048d1 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -208,15 +208,22 @@ func (ic *ContainerEngine) ContainerKill(ctx context.Context, namesOrIds []strin if err != nil { return nil, err } - ctrs, err := getContainersByContext(options.All, options.Latest, namesOrIds, ic.Libpod) + ctrs, rawInputs, err := getContainersAndInputByContext(options.All, options.Latest, namesOrIds, ic.Libpod) if err != nil { return nil, err } + ctrMap := map[string]string{} + if len(rawInputs) == len(ctrs) { + for i := range ctrs { + ctrMap[ctrs[i].ID()] = rawInputs[i] + } + } reports := make([]*entities.KillReport, 0, len(ctrs)) for _, con := range ctrs { reports = append(reports, &entities.KillReport{ - Id: con.ID(), - Err: con.Kill(uint(sig)), + Id: con.ID(), + Err: con.Kill(uint(sig)), + RawInput: ctrMap[con.ID()], }) } return reports, nil -- cgit v1.2.3-54-g00ecf