Allow subnets to have no gateway
diff --git a/openstack/networking/v2/subnets/requests.go b/openstack/networking/v2/subnets/requests.go
index 6cde048..1c7ef7b 100644
--- a/openstack/networking/v2/subnets/requests.go
+++ b/openstack/networking/v2/subnets/requests.go
@@ -108,6 +108,7 @@
TenantID string
AllocationPools []AllocationPool
GatewayIP string
+ NoGateway bool
IPVersion int
EnableDHCP *bool
DNSNameservers []string
@@ -139,6 +140,8 @@
}
if opts.GatewayIP != "" {
s["gateway_ip"] = opts.GatewayIP
+ } else if opts.NoGateway {
+ s["gateway_ip"] = nil
}
if opts.TenantID != "" {
s["tenant_id"] = opts.TenantID
@@ -184,6 +187,7 @@
type UpdateOpts struct {
Name string
GatewayIP string
+ NoGateway bool
DNSNameservers []string
HostRoutes []HostRoute
EnableDHCP *bool
@@ -201,6 +205,8 @@
}
if opts.GatewayIP != "" {
s["gateway_ip"] = opts.GatewayIP
+ } else if opts.NoGateway {
+ s["gateway_ip"] = nil
}
if opts.DNSNameservers != nil {
s["dns_nameservers"] = opts.DNSNameservers