diff options
Diffstat (limited to 'pkg/domain/infra/abi/pods.go')
-rw-r--r-- | pkg/domain/infra/abi/pods.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pkg/domain/infra/abi/pods.go b/pkg/domain/infra/abi/pods.go index 320880920..054b59b06 100644 --- a/pkg/domain/infra/abi/pods.go +++ b/pkg/domain/infra/abi/pods.go @@ -45,8 +45,8 @@ func getPodsByContext(all, latest bool, pods []string, runtime *libpod.Runtime) return outpods, err } -func (ic *ContainerEngine) PodExists(ctx context.Context, nameOrId string) (*entities.BoolReport, error) { - _, err := ic.Libpod.LookupPod(nameOrId) +func (ic *ContainerEngine) PodExists(ctx context.Context, nameOrID string) (*entities.BoolReport, error) { + _, err := ic.Libpod.LookupPod(nameOrID) if err != nil && errors.Cause(err) != define.ErrNoSuchPod { return nil, err } @@ -144,6 +144,7 @@ func (ic *ContainerEngine) PodStop(ctx context.Context, namesOrIds []string, opt var ( reports []*entities.PodStopReport ) + pods, err := getPodsByContext(options.All, options.Latest, namesOrIds, ic.Libpod) if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchPod) { return nil, err @@ -199,10 +200,12 @@ func (ic *ContainerEngine) PodStart(ctx context.Context, namesOrIds []string, op var ( reports []*entities.PodStartReport ) + pods, err := getPodsByContext(options.All, options.Latest, namesOrIds, ic.Libpod) if err != nil { return nil, err } + for _, p := range pods { report := entities.PodStartReport{Id: p.ID()} errs, err := p.Start(ctx) @@ -227,6 +230,7 @@ func (ic *ContainerEngine) PodRm(ctx context.Context, namesOrIds []string, optio var ( reports []*entities.PodRmReport ) + pods, err := getPodsByContext(options.All, options.Latest, namesOrIds, ic.Libpod) if err != nil && !(options.Ignore && errors.Cause(err) == define.ErrNoSuchPod) { return nil, err @@ -347,7 +351,7 @@ func (ic *ContainerEngine) PodPs(ctx context.Context, options entities.PodPSOpti Status: state.String(), }) } - infraId, err := p.InfraContainerID() + infraID, err := p.InfraContainerID() if err != nil { return nil, err } @@ -356,7 +360,7 @@ func (ic *ContainerEngine) PodPs(ctx context.Context, options entities.PodPSOpti Containers: lpcs, Created: p.CreatedTime(), Id: p.ID(), - InfraId: infraId, + InfraId: infraID, Name: p.Name(), Namespace: p.Namespace(), Status: status, |