summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod/networks.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/libpod/networks.go')
-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 {