summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-05-12 13:04:10 -0500
committerBrent Baude <bbaude@redhat.com>2020-05-12 13:23:43 -0500
commitcf502b99feda401ced410fbcfd1a3a2663c7a559 (patch)
tree408c4ae509fc8563da7ae1ac3f8d141cfd96e695 /pkg/domain
parent5b4e91db73a80f31f67b7c28832527e64b074b74 (diff)
downloadpodman-cf502b99feda401ced410fbcfd1a3a2663c7a559.tar.gz
podman-cf502b99feda401ced410fbcfd1a3a2663c7a559.tar.bz2
podman-cf502b99feda401ced410fbcfd1a3a2663c7a559.zip
enable podman v2 networking for remote client
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/entities/network.go1
-rw-r--r--pkg/domain/infra/tunnel/network.go27
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)
}