-
Notifications
You must be signed in to change notification settings - Fork 564
neutron: allow omission of subnet_id for IP address #3448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_ip
struct 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: