summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-09-16 11:01:52 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-09-16 11:01:52 +0200
commit5c7935057c34cbdb27be3a584d35bff3fcd81202 (patch)
tree6fd4ff71cc95308d655a0d52bf01affae13f2c92 /pkg/api/handlers/libpod
parent9119a578e782b92bd344f093f5491c318bc20d69 (diff)
downloadpodman-5c7935057c34cbdb27be3a584d35bff3fcd81202.tar.gz
podman-5c7935057c34cbdb27be3a584d35bff3fcd81202.tar.bz2
podman-5c7935057c34cbdb27be3a584d35bff3fcd81202.zip
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 <pholzing@redhat.com>
Diffstat (limited to 'pkg/api/handlers/libpod')
-rw-r--r--pkg/api/handlers/libpod/networks.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/api/handlers/libpod/networks.go b/pkg/api/handlers/libpod/networks.go
index fcd8e0231..1f7f2e26c 100644
--- a/pkg/api/handlers/libpod/networks.go
+++ b/pkg/api/handlers/libpod/networks.go
@@ -25,7 +25,7 @@ func CreateNetwork(w http.ResponseWriter, r *http.Request) {
}
ic := abi.ContainerEngine{Libpod: runtime}
- report, err := ic.Libpod.Network().NetworkCreate(network)
+ report, err := ic.NetworkCreate(r.Context(), network)
if err != nil {
utils.InternalServerError(w, err)
return