From 5c7935057c34cbdb27be3a584d35bff3fcd81202 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 16 Sep 2021 11:01:52 +0200 Subject: Do not allow network modes to be used as network names `podman network create` should not allow users to create networks with a name which is already used for a network mode in `podman run --network`. Fixes #11448 Signed-off-by: Paul Holzinger --- pkg/domain/infra/tunnel/network.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/domain/infra/tunnel') diff --git a/pkg/domain/infra/tunnel/network.go b/pkg/domain/infra/tunnel/network.go index 711c2e00c..6f227f565 100644 --- a/pkg/domain/infra/tunnel/network.go +++ b/pkg/domain/infra/tunnel/network.go @@ -62,12 +62,12 @@ func (ic *ContainerEngine) NetworkRm(ctx context.Context, namesOrIds []string, o return reports, nil } -func (ic *ContainerEngine) NetworkCreate(ctx context.Context, net types.Network) (*entities.NetworkCreateReport, error) { +func (ic *ContainerEngine) NetworkCreate(ctx context.Context, net types.Network) (*types.Network, error) { net, err := network.Create(ic.ClientCtx, &net) if err != nil { return nil, err } - return &entities.NetworkCreateReport{Name: net.Name}, nil + return &net, nil } // NetworkDisconnect removes a container from a given network -- cgit v1.2.3-54-g00ecf