diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-13 12:24:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-13 12:24:05 -0700 |
commit | 886b2cc4b10c32611b45da983fa9d1318d38356a (patch) | |
tree | 4484691fbb13faef71e7b11cfa3a81ab46c9fee2 /pkg/domain | |
parent | d147b3ee027580dd7afdeb0fa04d990ae1d2ee91 (diff) | |
parent | cf502b99feda401ced410fbcfd1a3a2663c7a559 (diff) | |
download | podman-886b2cc4b10c32611b45da983fa9d1318d38356a.tar.gz podman-886b2cc4b10c32611b45da983fa9d1318d38356a.tar.bz2 podman-886b2cc4b10c32611b45da983fa9d1318d38356a.zip |
Merge pull request #6197 from baude/v2remotenetwork
enable podman v2 networking for remote client
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/entities/network.go | 1 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/network.go | 27 |
2 files changed, 23 insertions, 5 deletions
diff --git a/pkg/domain/entities/network.go b/pkg/domain/entities/network.go index cffd40899..d001553e0 100644 --- a/pkg/domain/entities/network.go +++ b/pkg/domain/entities/network.go @@ -36,6 +36,7 @@ type NetworkRmReport struct { } // NetworkCreateOptions describes options to create a network +// swagger:model NetworkCreateOptions type NetworkCreateOptions struct { DisableDNS bool Driver string diff --git a/pkg/domain/infra/tunnel/network.go b/pkg/domain/infra/tunnel/network.go index 4ff72dcfc..7725d8257 100644 --- a/pkg/domain/infra/tunnel/network.go +++ b/pkg/domain/infra/tunnel/network.go @@ -2,22 +2,39 @@ package tunnel import ( "context" - "errors" + "github.com/containers/libpod/pkg/bindings/network" "github.com/containers/libpod/pkg/domain/entities" ) func (ic *ContainerEngine) NetworkList(ctx context.Context, options entities.NetworkListOptions) ([]*entities.NetworkListReport, error) { - return nil, errors.New("not implemented") + return network.List(ic.ClientCxt) } func (ic *ContainerEngine) NetworkInspect(ctx context.Context, namesOrIds []string, options entities.NetworkInspectOptions) ([]entities.NetworkInspectReport, error) { - return nil, errors.New("not implemented") + var reports []entities.NetworkInspectReport + for _, name := range namesOrIds { + report, err := network.Inspect(ic.ClientCxt, name) + if err != nil { + return nil, err + } + reports = append(reports, report...) + } + return reports, nil } + func (ic *ContainerEngine) NetworkRm(ctx context.Context, namesOrIds []string, options entities.NetworkRmOptions) ([]*entities.NetworkRmReport, error) { - return nil, errors.New("not implemented") + var reports []*entities.NetworkRmReport + for _, name := range namesOrIds { + report, err := network.Remove(ic.ClientCxt, name, &options.Force) + if err != nil { + report[0].Err = err + } + reports = append(reports, report...) + } + return reports, nil } func (ic *ContainerEngine) NetworkCreate(ctx context.Context, name string, options entities.NetworkCreateOptions) (*entities.NetworkCreateReport, error) { - return nil, errors.New("not implemented") + return network.Create(ic.ClientCxt, options, &name) } |