util

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package util implements util code.

Index

Constants

This section is empty.

Variables

View Source
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

func IsGlobalRoutingRequiredForTG(powerVSRegion string, vpcRegion string) bool

IsGlobalRoutingRequiredForTG returns true when powervs and vpc regions are different.

func VPCRegionForPowerVSRegion added in v0.8.0

func VPCRegionForPowerVSRegion(region string) (string, error)

VPCRegionForPowerVSRegion returns the VPC region for the specified PowerVS region.

func VPCZonesForPowerVSRegion added in v0.8.0

func VPCZonesForPowerVSRegion(region string) ([]string, error)

VPCZonesForPowerVSRegion returns the VPC zones associated with Power VS region.

Types

type Region added in v0.8.0

type Region struct {
	Description string
	VPCRegion   string
	COSRegion   string
	Zones       []string
	VPCZones    []string
	SysTypes    []string
}

Region describes respective IBM Cloud COS region, VPC region and Zones associated with a region in Power VS.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL