summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-11-11 15:31:03 +0100
committerGitHub <noreply@github.com>2020-11-11 15:31:03 +0100
commite443c01437d6b592a0d580f09d92d6c4ef795089 (patch)
tree098252c6f7699c286a1ef21b9cbb797a5158763f /pkg
parentbb07b8c9f1d6b8f24fef91d96cc9c3a3ea381d20 (diff)
parentb917b9925cb17ecb36472ab1122a1891825af38b (diff)
downloadpodman-e443c01437d6b592a0d580f09d92d6c4ef795089.tar.gz
podman-e443c01437d6b592a0d580f09d92d6c4ef795089.tar.bz2
podman-e443c01437d6b592a0d580f09d92d6c4ef795089.zip
Merge pull request #8295 from baude/issue8294
Set default network driver for APIv2 networks
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/libpod/networks.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/api/handlers/libpod/networks.go b/pkg/api/handlers/libpod/networks.go
index 9f6103c45..78e525f1f 100644
--- a/pkg/api/handlers/libpod/networks.go
+++ b/pkg/api/handlers/libpod/networks.go
@@ -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 {