1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Use default driver for IPAM if none

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2017-02-01 15:54:56 +01:00
parent 8f8c4f20e3
commit c322064127
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3

View file

@ -186,9 +186,13 @@ func BasicNetworkCreateToGRPC(create basictypes.NetworkCreateRequest) swarmapi.N
Attachable: create.Attachable,
}
if create.IPAM != nil {
driver := create.IPAM.Driver
if driver == "" {
driver = "default"
}
ns.IPAM = &swarmapi.IPAMOptions{
Driver: &swarmapi.Driver{
Name: create.IPAM.Driver,
Name: driver,
Options: create.IPAM.Options,
},
}