Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit fa1b308

Browse files
author
Keith Byrne
committed
Allow DNSNameservers and HostRoutes to be removed
Check against nil instead of len == 0 when updating DNSNameservers and HostRoutes. This allows the removal of already configured properties.
1 parent 1d8b6f1 commit fa1b308

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openstack/networking/v2/subnets/requests.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ func (opts UpdateOpts) ToSubnetUpdateMap() (map[string]interface{}, error) {
202202
if opts.GatewayIP != "" {
203203
s["gateway_ip"] = opts.GatewayIP
204204
}
205-
if len(opts.DNSNameservers) != 0 {
205+
if opts.DNSNameservers != nil {
206206
s["dns_nameservers"] = opts.DNSNameservers
207207
}
208-
if len(opts.HostRoutes) != 0 {
208+
if opts.HostRoutes != nil {
209209
s["host_routes"] = opts.HostRoutes
210210
}
211211

0 commit comments

Comments
 (0)