validate

package
v0.0.0-...-fde486f Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 14

Documentation

Index

Constants

View Source
const VMRoleMaster string = "master"
View Source
const VMRoleWorker string = "worker"

Variables

View Source
var (
	RxClusterID           = regexp.MustCompile(`(?i)^/subscriptions/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/resourceGroups/[-a-z0-9_().]{0,89}[-a-z0-9_()]/providers/Microsoft\.RedHatOpenShift/openShiftClusters/[-a-z0-9_().]{0,89}[-a-z0-9_()]$`)
	RxResourceGroupID     = regexp.MustCompile(`(?i)^/subscriptions/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/resourceGroups/[-a-z0-9_().]{0,89}[-a-z0-9_()]$`)
	RxSubnetID            = regexp.MustCompile(`(?i)^/subscriptions/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/resourceGroups/[-a-z0-9_().]{0,89}[-a-z0-9_()]/providers/Microsoft\.Network/virtualNetworks/[-a-z0-9_.]{2,64}/subnets/[-a-z0-9_.]{2,80}$`)
	RxDiskEncryptionSetID = regexp.MustCompile(`(?i)^/subscriptions/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/resourceGroups/[-a-z0-9_().]{0,89}[-a-z0-9_()]/providers/Microsoft\.Compute/diskEncryptionSets/[-a-z0-9_]{1,80}$`)
	RxDomainName          = regexp.MustCompile(`^` +
		`([a-z][-a-z0-9]{0,61}[a-z0-9])` +
		`(\.([a-z0-9]|[a-z0-9][-a-z0-9]{0,61}[a-z0-9]))*` +
		`$`)
	RxDomainNameRFC1123 = regexp.MustCompile(`^` +
		`([a-z0-9]|[a-z0-9][-a-z0-9]{0,61}[a-z0-9])` +
		`(\.([a-z0-9]|[a-z0-9][-a-z0-9]{0,61}[a-z0-9]))*` +
		`$`)
)

Regular expressions used to validate the format of resource names and IDs acceptable by API.

Functions

func DiskSizeIsValid

func DiskSizeIsValid(sizeGB int) bool

func SupportedVMSizesByRole

func SupportedVMSizesByRole(vmRole string) map[api.VMSize]api.VMSizeStruct

func VMSizeFromName

func VMSizeFromName(vmSize api.VMSize) (api.VMSizeStruct, bool)

func VMSizeIsValid

func VMSizeIsValid(vmSize api.VMSize, requiredD2sV3Workers, isMaster bool) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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