diff options
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/network.go | 6 | ||||
-rw-r--r-- | pkg/domain/infra/abi/play.go | 26 | ||||
-rw-r--r-- | pkg/domain/infra/abi/system.go | 19 |
3 files changed, 33 insertions, 18 deletions
diff --git a/pkg/domain/infra/abi/network.go b/pkg/domain/infra/abi/network.go index 4f572fb88..06941f8d0 100644 --- a/pkg/domain/infra/abi/network.go +++ b/pkg/domain/infra/abi/network.go @@ -110,7 +110,11 @@ func (ic *ContainerEngine) NetworkRm(ctx context.Context, namesOrIds []string, o } func (ic *ContainerEngine) NetworkCreate(ctx context.Context, name string, options entities.NetworkCreateOptions) (*entities.NetworkCreateReport, error) { - return network.Create(name, options, ic.Libpod) + runtimeConfig, err := ic.Libpod.GetConfig() + if err != nil { + return nil, err + } + return network.Create(name, options, runtimeConfig) } func ifPassesFilterTest(netconf *libcni.NetworkConfigList, filter []string) bool { diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index c0948e099..4bcc6469c 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -297,20 +297,22 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY containers = append(containers, ctr) } - //start the containers - podStartErrors, err := pod.Start(ctx) - if err != nil { - return nil, err - } + if options.Start != types.OptionalBoolFalse { + //start the containers + podStartErrors, err := pod.Start(ctx) + if err != nil { + 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 + // 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 _, e := range podStartErrors { + if e != nil { + return nil, e + } } } diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index 613c4a6d8..72fd98ac1 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -17,6 +17,7 @@ import ( "github.com/containers/podman/v2/pkg/rootless" "github.com/containers/podman/v2/pkg/util" "github.com/containers/podman/v2/utils" + "github.com/containers/storage" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -231,17 +232,25 @@ func (ic *ContainerEngine) SystemDf(ctx context.Context, options entities.System dfContainers := make([]*entities.SystemDfContainerReport, 0, len(cons)) for _, c := range cons { iid, _ := c.Image() - conSize, err := c.RootFsSize() + state, err := c.State() if err != nil { - return nil, err + return nil, errors.Wrapf(err, "Failed to get state of container %s", c.ID()) } - state, err := c.State() + conSize, err := c.RootFsSize() if err != nil { - return nil, err + if errors.Cause(err) == storage.ErrContainerUnknown { + logrus.Error(errors.Wrapf(err, "Failed to get root file system size of container %s", c.ID())) + } else { + return nil, errors.Wrapf(err, "Failed to get root file system size of container %s", c.ID()) + } } rwsize, err := c.RWSize() if err != nil { - return nil, err + if errors.Cause(err) == storage.ErrContainerUnknown { + logrus.Error(errors.Wrapf(err, "Failed to get read/write size of container %s", c.ID())) + } else { + return nil, errors.Wrapf(err, "Failed to get read/write size of container %s", c.ID()) + } } report := entities.SystemDfContainerReport{ ContainerID: c.ID(), |