-
Notifications
You must be signed in to change notification settings - Fork 278
Description
The Networks type has been abused for use in multiple dissimilar places. It is currently used in:
-
OpenStackClusterStatus.Network
This is its primary use, although the PortOpts field is not used here, meaning it is unnecessarily added to the API. Also the APIServerLoadBalancer field doesn't need to be here: it could reasonably be its own top-level field. -
OpenStackClusterStatus.ExternalNetwork
Only the ID, Name, and Tags fields are set, and of these only the ID field is used. This could be replaced by ExternalNetworkID. -
OpenStackClusterStatus.Bastion.Networks
This isn't even used. Nothing sets this, but it's still polluting the API.
The struct is additionally used internally to pass data between constructNetworks() and GetOrCreatePort(). This is the only use of the PortOpts field, which is incidentally the only required data used in this flow. This code should be refactored to pass PortOpts instead.
TODO:
- Remove Bastion.Networks #1545
- Remove PortOpts from Network #1549
- ExternalNetwork should not have Subnet and APIServerLoadBalancer #1552
- Move APIServerLoadBalancer to its own separate field #1553
- Update Networks to support dual-stack (multiple subnets support)