diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-27 17:04:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 17:04:44 -0400 |
commit | 7149a7cb396dd5951f9c632e79ba3c96a7797c5f (patch) | |
tree | b3dcd6379cd01e4d9b4bd64d89fe75a092c7ec43 /pkg/domain/infra/abi/network.go | |
parent | 26c09291a3ea2b0e05d033a1ecf0441403d0d31a (diff) | |
parent | 61deec451f279cdc09b4415fe4988c2f8548e55a (diff) | |
download | podman-7149a7cb396dd5951f9c632e79ba3c96a7797c5f.tar.gz podman-7149a7cb396dd5951f9c632e79ba3c96a7797c5f.tar.bz2 podman-7149a7cb396dd5951f9c632e79ba3c96a7797c5f.zip |
Merge pull request #8102 from ashley-cui/inspect
Add pod, volume, network to inspect package
Diffstat (limited to 'pkg/domain/infra/abi/network.go')
-rw-r--r-- | pkg/domain/infra/abi/network.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/pkg/domain/infra/abi/network.go b/pkg/domain/infra/abi/network.go index f40df828a..4f572fb88 100644 --- a/pkg/domain/infra/abi/network.go +++ b/pkg/domain/infra/abi/network.go @@ -43,21 +43,26 @@ func (ic *ContainerEngine) NetworkList(ctx context.Context, options entities.Net return reports, nil } -func (ic *ContainerEngine) NetworkInspect(ctx context.Context, namesOrIds []string, options entities.NetworkInspectOptions) ([]entities.NetworkInspectReport, error) { +func (ic *ContainerEngine) NetworkInspect(ctx context.Context, namesOrIds []string, options entities.InspectOptions) ([]entities.NetworkInspectReport, []error, error) { config, err := ic.Libpod.GetConfig() if err != nil { - return nil, err + return nil, nil, err } - + var errs []error rawCNINetworks := make([]entities.NetworkInspectReport, 0, len(namesOrIds)) for _, name := range namesOrIds { rawList, err := network.InspectNetwork(config, name) if err != nil { - return nil, err + if errors.Cause(err) == define.ErrNoSuchNetwork { + errs = append(errs, errors.Errorf("no such network %s", name)) + continue + } else { + return nil, nil, errors.Wrapf(err, "error inspecting network %s", name) + } } rawCNINetworks = append(rawCNINetworks, rawList) } - return rawCNINetworks, nil + return rawCNINetworks, errs, nil } func (ic *ContainerEngine) NetworkRm(ctx context.Context, namesOrIds []string, options entities.NetworkRmOptions) ([]*entities.NetworkRmReport, error) { |