mirror of https://github.com/containers/podman.git
Set default network driver for APIv2 networks
Recent changes in networking require that the cni network driver be set. If the user provides no driver, we set the driver to the defaultnetworkdriver which currently is "bridge". Fixes: #8294 Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
parent
ca672373b5
commit
b917b9925c
|
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
"github.com/containers/podman/v2/libpod"
|
||||
"github.com/containers/podman/v2/libpod/define"
|
||||
"github.com/containers/podman/v2/libpod/network"
|
||||
"github.com/containers/podman/v2/pkg/api/handlers/utils"
|
||||
"github.com/containers/podman/v2/pkg/domain/entities"
|
||||
"github.com/containers/podman/v2/pkg/domain/infra/abi"
|
||||
|
|
@ -31,6 +32,9 @@ func CreateNetwork(w http.ResponseWriter, r *http.Request) {
|
|||
errors.Wrapf(err, "failed to parse parameters for %s", r.URL.String()))
|
||||
return
|
||||
}
|
||||
if len(options.Driver) < 1 {
|
||||
options.Driver = network.DefaultNetworkDriver
|
||||
}
|
||||
ic := abi.ContainerEngine{Libpod: runtime}
|
||||
report, err := ic.NetworkCreate(r.Context(), query.Name, options)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
t GET networks/non-existing-network 404 \
|
||||
.cause='network not found'
|
||||
|
||||
# FIXME FIXME FIXME: failing in CI. Deferring to someone else to fix later.
|
||||
#if root; then
|
||||
if false; then
|
||||
t POST libpod/networks/create?name=network1 '' 200 \
|
||||
.Filename~.*/network1\\.conflist
|
||||
|
||||
|
|
@ -52,6 +49,5 @@ if false; then
|
|||
.[0].Name~network2 \
|
||||
.[0].Err=null
|
||||
|
||||
fi
|
||||
|
||||
# vim: filetype=sh
|
||||
|
|
|
|||
Loading…
Reference in New Issue