diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-02-16 09:46:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-16 09:46:28 -0500 |
commit | 58a4793bec30058f648dcd1248da333a7bb6d47c (patch) | |
tree | de220666eba07d3183e95299bb1485ffe5f383d3 /pkg/domain/infra/tunnel/containers.go | |
parent | aadb16da383a91489821969247bced2b34d885e7 (diff) | |
parent | 4a9bd7a18f2db7db103a94287ef34cbd1be1626b (diff) | |
download | podman-58a4793bec30058f648dcd1248da333a7bb6d47c.tar.gz podman-58a4793bec30058f648dcd1248da333a7bb6d47c.tar.bz2 podman-58a4793bec30058f648dcd1248da333a7bb6d47c.zip |
Merge pull request #9396 from rhatdan/stop
When stopping a container, print rawInput
Diffstat (limited to 'pkg/domain/infra/tunnel/containers.go')
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index c2c282ef9..5a83faaf0 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -82,16 +82,23 @@ func (ic *ContainerEngine) ContainerUnpause(ctx context.Context, namesOrIds []st func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []string, opts entities.StopOptions) ([]*entities.StopReport, error) { reports := []*entities.StopReport{} - ctrs, err := getContainersByContext(ic.ClientCtx, opts.All, opts.Ignore, namesOrIds) + ctrs, rawInputs, err := getContainersAndInputByContext(ic.ClientCtx, opts.All, opts.Ignore, namesOrIds) if err != nil { return nil, err } + ctrMap := map[string]string{} + for i := range ctrs { + ctrMap[ctrs[i].ID] = rawInputs[i] + } options := new(containers.StopOptions).WithIgnore(opts.Ignore) if to := opts.Timeout; to != nil { options.WithTimeout(*to) } for _, c := range ctrs { - report := entities.StopReport{Id: c.ID} + report := entities.StopReport{ + Id: c.ID, + RawInput: ctrMap[c.ID], + } if err = containers.Stop(ic.ClientCtx, c.ID, options); err != nil { // These first two are considered non-fatal under the right conditions if errors.Cause(err).Error() == define.ErrCtrStopped.Error() { |