diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-06-04 14:52:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-04 14:52:25 +0200 |
commit | c133e55afc7d5c44a65c4021bf206b65073422a5 (patch) | |
tree | c7ff514a206d96ddf573dac238166916e11f802b | |
parent | 6682ea8f0d18e24d3fc40518da283c0b9030aba0 (diff) | |
parent | f313a8844156a574a30186364f084ab11ae9b162 (diff) | |
download | podman-c133e55afc7d5c44a65c4021bf206b65073422a5.tar.gz podman-c133e55afc7d5c44a65c4021bf206b65073422a5.tar.bz2 podman-c133e55afc7d5c44a65c4021bf206b65073422a5.zip |
Merge pull request #6485 from QiWang19/remote-ignore
fix remote test --ignore & turn on more tests
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 4 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/pods.go | 5 | ||||
-rw-r--r-- | test/e2e/pod_rm_test.go | 1 | ||||
-rw-r--r-- | test/e2e/pod_stop_test.go | 2 | ||||
-rw-r--r-- | test/e2e/rm_test.go | 1 |
5 files changed, 5 insertions, 8 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 36a510081..36b7bf535 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -95,7 +95,7 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin namesOrIds = append(namesOrIds, id) } ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds) - if err != nil { + if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchCtr) { return nil, err } for _, c := range ctrs { @@ -180,7 +180,7 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string, namesOrIds = append(namesOrIds, id) } ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds) - if err != nil { + if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchCtr) { return nil, err } // TODO there is no endpoint for container eviction. Need to discuss diff --git a/pkg/domain/infra/tunnel/pods.go b/pkg/domain/infra/tunnel/pods.go index c193c6752..b93c48aab 100644 --- a/pkg/domain/infra/tunnel/pods.go +++ b/pkg/domain/infra/tunnel/pods.go @@ -3,6 +3,7 @@ package tunnel import ( "context" + "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/bindings/pods" "github.com/containers/libpod/pkg/domain/entities" "github.com/containers/libpod/pkg/specgen" @@ -89,7 +90,7 @@ func (ic *ContainerEngine) PodStop(ctx context.Context, namesOrIds []string, opt timeout int = -1 ) foundPods, err := getPodsByContext(ic.ClientCxt, options.All, namesOrIds) - if err != nil { + if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchPod) { return nil, err } if options.Timeout != -1 { @@ -155,7 +156,7 @@ func (ic *ContainerEngine) PodStart(ctx context.Context, namesOrIds []string, op func (ic *ContainerEngine) PodRm(ctx context.Context, namesOrIds []string, options entities.PodRmOptions) ([]*entities.PodRmReport, error) { var reports []*entities.PodRmReport foundPods, err := getPodsByContext(ic.ClientCxt, options.All, namesOrIds) - if err != nil { + if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchPod) { return nil, err } for _, p := range foundPods { diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go index e10b3c98f..4060e1268 100644 --- a/test/e2e/pod_rm_test.go +++ b/test/e2e/pod_rm_test.go @@ -213,7 +213,6 @@ var _ = Describe("Podman pod rm", func() { }) It("podman rm --ignore bogus pod and a running pod", func() { - SkipIfRemote() _, ec, podid1 := podmanTest.CreatePod("") Expect(ec).To(Equal(0)) diff --git a/test/e2e/pod_stop_test.go b/test/e2e/pod_stop_test.go index 298f3da2f..0a46b07c9 100644 --- a/test/e2e/pod_stop_test.go +++ b/test/e2e/pod_stop_test.go @@ -39,7 +39,6 @@ var _ = Describe("Podman pod stop", func() { }) It("podman pod stop --ignore bogus pod", func() { - SkipIfRemote() session := podmanTest.Podman([]string{"pod", "stop", "--ignore", "123"}) session.WaitWithDefaultTimeout() @@ -60,7 +59,6 @@ var _ = Describe("Podman pod stop", func() { }) It("podman stop --ignore bogus pod and a running pod", func() { - SkipIfRemote() _, ec, podid1 := podmanTest.CreatePod("") Expect(ec).To(Equal(0)) diff --git a/test/e2e/rm_test.go b/test/e2e/rm_test.go index 6b554cd84..d0dbd527a 100644 --- a/test/e2e/rm_test.go +++ b/test/e2e/rm_test.go @@ -233,7 +233,6 @@ var _ = Describe("Podman rm", func() { }) It("podman rm --ignore bogus container and a running container", func() { - SkipIfRemote() session := podmanTest.RunTopContainer("test1") session.WaitWithDefaultTimeout() |