diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-11 17:06:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 17:06:49 -0500 |
commit | 63d8f535ec93b5e83257e39b9d656747c4bedfcc (patch) | |
tree | a927d255621be74269f9406466f9f1b3b6adfe35 /pkg/domain/infra/abi | |
parent | 20217f578941a207fadac92535f4b56bca99e424 (diff) | |
parent | 7e3fb33be85122d509756e197aac10c4cf9930b6 (diff) | |
download | podman-63d8f535ec93b5e83257e39b9d656747c4bedfcc.tar.gz podman-63d8f535ec93b5e83257e39b9d656747c4bedfcc.tar.bz2 podman-63d8f535ec93b5e83257e39b9d656747c4bedfcc.zip |
Merge pull request #8917 from mheon/actually_report_play_kube_errors
Ensure that `podman play kube` actually reports errors
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/play.go | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index cbc74a2f2..70c7104f1 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -10,6 +10,7 @@ import ( "github.com/containers/image/v5/types" "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/define" "github.com/containers/podman/v2/libpod/image" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/containers/podman/v2/pkg/specgen/generate" @@ -251,21 +252,13 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY } if options.Start != types.OptionalBoolFalse { - //start the containers + // Start the containers podStartErrors, err := pod.Start(ctx) - if err != nil { + if err != nil && errors.Cause(err) != define.ErrPodPartialFail { return nil, err } - - // Previous versions of playkube started containers individually and then - // looked for errors. Because we now use the uber-Pod start call, we should - // iterate the map of possible errors and return one if there is a problem. This - // keeps the behavior the same - - for _, e := range podStartErrors { - if e != nil { - return nil, e - } + for id, err := range podStartErrors { + playKubePod.ContainerErrors = append(playKubePod.ContainerErrors, errors.Wrapf(err, "error starting container %s", id).Error()) } } |