aboutsummaryrefslogtreecommitdiff
path: root/pkg/domain/infra/tunnel/network.go
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/infra/tunnel/network.go
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/infra/tunnel/network.go')
-rw-r--r--pkg/domain/infra/tunnel/network.go27
1 files changed, 22 insertions, 5 deletions
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)
}