neutron: allow omission of subnet_id for IP address#3448
neutron: allow omission of subnet_id for IP address#3448kayrus merged 1 commit intogophercloud:mainfrom
Conversation
mandre
left a comment
There was a problem hiding this comment.
I don't think this has any effect. You're adding an omitempty for fields in structs that are returned to the user, but according to the docs, the subnet ID is always populated:
The IP addresses for the port. If the port has multiple IP addresses, this field has multiple entries. Each entry consists of IP address (ip_address) and the subnet ID from which the IP address is assigned (subnet_id).
That said, the change is not harmful, and it doesn't really makes sense to me why IPAddress had an omitempty tag, so... I guess we can add one for SubnetID for consistency?
not really, this struct is used in |
OK, I see the |
mandre
left a comment
There was a problem hiding this comment.
The neutron docs for the router creation states that:
The external gateway information of the router. If the router has an external gateway, this would be a dict with network_id, enable_snat, external_fixed_ips and qos_policy_id. Otherwise, this would be null.
However, it doesn't say what format external_fixed_ips must have. I think it's fair to add an omitempty for the subnet ID. And you have test cases to show that SubnetID is indeed optional, so all good.
you're right. I was referring to port CreateOpts, but then I realized that it has
👍 |
I could not find any docs about
external_fixed_ipstruct to support omittedsubnet_id, but I created test case in terraform provider and it works as expected, see terraform-provider-openstack/terraform-provider-openstack#1915As for the port's
subnet_id, the omission behavior is documented here: