Skip to content

Streamline Networks type #1544

@mdbooth

Description

@mdbooth

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions