mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Merge pull request #6485 from QiWang19/remote-ignore
fix remote test --ignore & turn on more tests
This commit is contained in:
@ -95,7 +95,7 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
|
|||||||
namesOrIds = append(namesOrIds, id)
|
namesOrIds = append(namesOrIds, id)
|
||||||
}
|
}
|
||||||
ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds)
|
ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds)
|
||||||
if err != nil {
|
if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchCtr) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, c := range ctrs {
|
for _, c := range ctrs {
|
||||||
@ -180,7 +180,7 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string,
|
|||||||
namesOrIds = append(namesOrIds, id)
|
namesOrIds = append(namesOrIds, id)
|
||||||
}
|
}
|
||||||
ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds)
|
ctrs, err := getContainersByContext(ic.ClientCxt, options.All, namesOrIds)
|
||||||
if err != nil {
|
if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchCtr) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// TODO there is no endpoint for container eviction. Need to discuss
|
// TODO there is no endpoint for container eviction. Need to discuss
|
||||||
|
@ -3,6 +3,7 @@ package tunnel
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/containers/libpod/libpod/define"
|
||||||
"github.com/containers/libpod/pkg/bindings/pods"
|
"github.com/containers/libpod/pkg/bindings/pods"
|
||||||
"github.com/containers/libpod/pkg/domain/entities"
|
"github.com/containers/libpod/pkg/domain/entities"
|
||||||
"github.com/containers/libpod/pkg/specgen"
|
"github.com/containers/libpod/pkg/specgen"
|
||||||
@ -89,7 +90,7 @@ func (ic *ContainerEngine) PodStop(ctx context.Context, namesOrIds []string, opt
|
|||||||
timeout int = -1
|
timeout int = -1
|
||||||
)
|
)
|
||||||
foundPods, err := getPodsByContext(ic.ClientCxt, options.All, namesOrIds)
|
foundPods, err := getPodsByContext(ic.ClientCxt, options.All, namesOrIds)
|
||||||
if err != nil {
|
if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchPod) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if options.Timeout != -1 {
|
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) {
|
func (ic *ContainerEngine) PodRm(ctx context.Context, namesOrIds []string, options entities.PodRmOptions) ([]*entities.PodRmReport, error) {
|
||||||
var reports []*entities.PodRmReport
|
var reports []*entities.PodRmReport
|
||||||
foundPods, err := getPodsByContext(ic.ClientCxt, options.All, namesOrIds)
|
foundPods, err := getPodsByContext(ic.ClientCxt, options.All, namesOrIds)
|
||||||
if err != nil {
|
if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchPod) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, p := range foundPods {
|
for _, p := range foundPods {
|
||||||
|
@ -213,7 +213,6 @@ var _ = Describe("Podman pod rm", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman rm --ignore bogus pod and a running pod", func() {
|
It("podman rm --ignore bogus pod and a running pod", func() {
|
||||||
SkipIfRemote()
|
|
||||||
|
|
||||||
_, ec, podid1 := podmanTest.CreatePod("")
|
_, ec, podid1 := podmanTest.CreatePod("")
|
||||||
Expect(ec).To(Equal(0))
|
Expect(ec).To(Equal(0))
|
||||||
|
@ -39,7 +39,6 @@ var _ = Describe("Podman pod stop", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman pod stop --ignore bogus pod", func() {
|
It("podman pod stop --ignore bogus pod", func() {
|
||||||
SkipIfRemote()
|
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"pod", "stop", "--ignore", "123"})
|
session := podmanTest.Podman([]string{"pod", "stop", "--ignore", "123"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
@ -60,7 +59,6 @@ var _ = Describe("Podman pod stop", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman stop --ignore bogus pod and a running pod", func() {
|
It("podman stop --ignore bogus pod and a running pod", func() {
|
||||||
SkipIfRemote()
|
|
||||||
|
|
||||||
_, ec, podid1 := podmanTest.CreatePod("")
|
_, ec, podid1 := podmanTest.CreatePod("")
|
||||||
Expect(ec).To(Equal(0))
|
Expect(ec).To(Equal(0))
|
||||||
|
@ -233,7 +233,6 @@ var _ = Describe("Podman rm", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman rm --ignore bogus container and a running container", func() {
|
It("podman rm --ignore bogus container and a running container", func() {
|
||||||
SkipIfRemote()
|
|
||||||
|
|
||||||
session := podmanTest.RunTopContainer("test1")
|
session := podmanTest.RunTopContainer("test1")
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
Reference in New Issue
Block a user