Documentation ¶
Overview ¶
Package util implements util code.
Index ¶
- Variables
- func CheckCreateInfraAnnotation(cluster infrav1beta2.IBMPowerVSCluster) bool
- func GetClusterByName(ctx context.Context, c client.Client, namespace, name string) (*infrav1beta2.IBMPowerVSCluster, error)
- func GetTransitGatewayLocationAndRouting(powerVSZone *string, vpcRegion *string) (*string, *bool, error)
- func IsGlobalRoutingRequiredForTG(powerVSRegion string, vpcRegion string) bool
- func VPCRegionForPowerVSRegion(region string) (string, error)
- func VPCZonesForPowerVSRegion(region string) ([]string, error)
- type Region
Constants ¶
This section is empty.
Variables ¶
var Regions = map[string]Region{ "dal": { Description: "Dallas, USA", VPCRegion: "us-south", COSRegion: "us-south", Zones: []string{ "dal10", "dal12", }, SysTypes: []string{"s922", "e980"}, VPCZones: []string{"us-south-1", "us-south-2", "us-south-3"}, }, "eu-de": { Description: "Frankfurt, Germany", VPCRegion: "eu-de", COSRegion: "eu-de", Zones: []string{ "eu-de-1", "eu-de-2", }, SysTypes: []string{"s922", "e980"}, VPCZones: []string{"eu-de-2", "eu-de-3"}, }, "lon": { Description: "London, UK.", VPCRegion: "eu-gb", COSRegion: "eu-gb", Zones: []string{ "lon04", "lon06", }, SysTypes: []string{"s922", "e980"}, VPCZones: []string{"eu-gb-1", "eu-gb-3"}, }, "mad": { Description: "Madrid, Spain", VPCRegion: "eu-es", COSRegion: "eu-de", Zones: []string{ "mad02", "mad04", }, SysTypes: []string{"s1022"}, VPCZones: []string{"eu-es-1", "eu-es-2"}, }, "mon": { Description: "Montreal, Canada", VPCRegion: "ca-tor", COSRegion: "ca-tor", Zones: []string{"mon01"}, SysTypes: []string{"s922", "e980"}, }, "osa": { Description: "Osaka, Japan", VPCRegion: "jp-osa", COSRegion: "jp-osa", Zones: []string{"osa21"}, SysTypes: []string{"s922", "e980"}, VPCZones: []string{"jp-osa-1"}, }, "syd": { Description: "Sydney, Australia", VPCRegion: "au-syd", COSRegion: "au-syd", Zones: []string{ "syd04", "syd05", }, SysTypes: []string{"s922", "e980"}, VPCZones: []string{"au-syd-2", "au-syd-3"}, }, "sao": { Description: "São Paulo, Brazil", VPCRegion: "br-sao", COSRegion: "br-sao", Zones: []string{ "sao01", "sao04", }, SysTypes: []string{"s922", "e980"}, VPCZones: []string{"br-sao-1", "br-sao-2"}, }, "tok": { Description: "Tokyo, Japan", VPCRegion: "jp-tok", COSRegion: "jp-tok", Zones: []string{"tok04"}, SysTypes: []string{"s922", "e980"}, VPCZones: []string{"jp-tok-2"}, }, "us-east": { Description: "Washington DC, USA", VPCRegion: "us-east", COSRegion: "us-east", Zones: []string{"us-east"}, SysTypes: []string{}, VPCZones: []string{"us-east-1", "us-east-2", "us-east-3"}, }, "wdc": { Description: "Washington DC, USA", VPCRegion: "us-east", COSRegion: "us-east", Zones: []string{ "wdc06", "wdc07", }, SysTypes: []string{"s922", "e980"}, VPCZones: []string{"us-east-1", "us-east-2", "us-east-3"}, }, }
Regions provides a mapping between Power VS and IBM Cloud VPC and IBM COS regions.
Functions ¶
func CheckCreateInfraAnnotation ¶ added in v0.8.0
func CheckCreateInfraAnnotation(cluster infrav1beta2.IBMPowerVSCluster) bool
CheckCreateInfraAnnotation checks for annotations set on IBMPowerVSCluster object to determine cluster creation workflow.
func GetClusterByName ¶
func GetClusterByName(ctx context.Context, c client.Client, namespace, name string) (*infrav1beta2.IBMPowerVSCluster, error)
GetClusterByName finds and return a Cluster object using the specified params.
func GetTransitGatewayLocationAndRouting ¶ added in v0.8.0
func GetTransitGatewayLocationAndRouting(powerVSZone *string, vpcRegion *string) (*string, *bool, error)
GetTransitGatewayLocationAndRouting returns appropriate location and routing suitable for transit gateway. routing indicates whether to enable global routing on transit gateway or not. returns true when PowerVS and VPC region are not same otherwise false.
func IsGlobalRoutingRequiredForTG ¶ added in v0.8.0
IsGlobalRoutingRequiredForTG returns true when powervs and vpc regions are different.
func VPCRegionForPowerVSRegion ¶ added in v0.8.0
VPCRegionForPowerVSRegion returns the VPC region for the specified PowerVS region.
func VPCZonesForPowerVSRegion ¶ added in v0.8.0
VPCZonesForPowerVSRegion returns the VPC zones associated with Power VS region.