azure

package
v0.0.0-...-d6be293 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultUserName is the default username for created vm
	DefaultUserName = "capi"
	// DefaultVnetCIDR is the default Vnet CIDR
	DefaultVnetCIDR = "10.0.0.0/8"
	// DefaultControlPlaneSubnetCIDR is the default Control Plane Subnet CIDR
	DefaultControlPlaneSubnetCIDR = "10.0.0.0/16"
	// DefaultNodeSubnetCIDR is the default Node Subnet CIDR
	DefaultNodeSubnetCIDR = "10.1.0.0/16"
	// DefaultInternalLBIPAddress is the default internal load balancer ip address
	DefaultInternalLBIPAddress = "10.0.0.100"
	// DefaultAzureDNSZone is the default provided azure dns zone
	DefaultAzureDNSZone = "cloudapp.azure.com"
)
View Source
const (
	// UserAgent used for communicating with azure
	UserAgent = "cluster-api-azure-services"
)

Variables

This section is empty.

Functions

func GenerateControlPlaneSecurityGroupName

func GenerateControlPlaneSecurityGroupName(clusterName string) string

GenerateControlPlaneSecurityGroupName generates a control plane security group name, based on the cluster name.

func GenerateControlPlaneSubnetName

func GenerateControlPlaneSubnetName(clusterName string) string

GenerateControlPlaneSubnetName generates a node subnet name, based on the cluster name.

func GenerateDataDiskName

func GenerateDataDiskName(machineName, suffix string) string

GenerateDataDiskName generates Data disks names used by VM

func GenerateFQDN

func GenerateFQDN(publicIPName, location string) string

GenerateFQDN generates a fully qualified domain name, based on the public IP name and cluster location.

func GenerateInternalLBName

func GenerateInternalLBName(clusterName string) string

GenerateInternalLBName generates a internal load balancer name, based on the cluster name.

func GenerateMachineProviderID

func GenerateMachineProviderID(subscriptionID, resourceGroupName, machineName string) string

GenerateMachineProviderID generates machine provider id.

func GenerateMachinePublicIPName

func GenerateMachinePublicIPName(clusterName, machineName string) (string, error)

GenerateMachinePublicIPName generates a public IP name for a machine, based on the cluster name and a hash.

func GenerateManagedIdentityName

func GenerateManagedIdentityName(subscriptionID, resourceGroupName, managedIdentityName string) string

GenerateManagedIdentityName generates managed identity name.

func GenerateNetworkInterfaceName

func GenerateNetworkInterfaceName(machineName string) string

GenerateNetworkInterfaceName generates network interface name used by VM

func GenerateNodeRouteTableName

func GenerateNodeRouteTableName(clusterName string) string

GenerateNodeRouteTableName generates a node route table name, based on the cluster name.

func GenerateNodeSecurityGroupName

func GenerateNodeSecurityGroupName(clusterName string) string

GenerateNodeSecurityGroupName generates a node security group name, based on the cluster name.

func GenerateNodeSubnetName

func GenerateNodeSubnetName(clusterName string) string

GenerateNodeSubnetName generates a node subnet name, based on the cluster name.

func GenerateOSDiskName

func GenerateOSDiskName(machineName string) string

GenerateOSDiskName generates OS disk name used by VM

func GeneratePublicIPName

func GeneratePublicIPName(clusterName, hash string) string

GeneratePublicIPName generates a public IP name, based on the cluster name and a hash.

func GeneratePublicLBName

func GeneratePublicLBName(clusterName string) string

GeneratePublicLBName generates a public load balancer name, based on the cluster name.

func GenerateVnetName

func GenerateVnetName(clusterName string) string

GenerateVnetName generates a virtual network name, based on the cluster name.

func InvalidCredentials

func InvalidCredentials(err error) bool

InvalidCredentials parses the error to check if its an invalid credentials error

func ResourceNotFound

func ResourceNotFound(err error) bool

ResourceNotFound parses the error to check if its a resource not found

Types

type FakeCachedService

type FakeCachedService struct {
	Cache *map[string]int
}

FakeCachedService updates the cache with name whenefver createorupdate is called

func (*FakeCachedService) CreateOrUpdate

func (s *FakeCachedService) CreateOrUpdate(ctx context.Context, spec Spec) error

CreateOrUpdate returns fake success.

func (*FakeCachedService) Delete

func (s *FakeCachedService) Delete(ctx context.Context, spec Spec) error

Delete returns fake success.

func (*FakeCachedService) Get

func (s *FakeCachedService) Get(ctx context.Context, spec Spec) (interface{}, error)

Get returns fake success.

type FakeFailureService

type FakeFailureService struct {
}

FakeFailureService generic service which always returns failure.

func (*FakeFailureService) CreateOrUpdate

func (s *FakeFailureService) CreateOrUpdate(ctx context.Context, spec Spec) error

CreateOrUpdate returns fake failure.

func (*FakeFailureService) Delete

func (s *FakeFailureService) Delete(ctx context.Context, spec Spec) error

Delete returns fake failure.

func (*FakeFailureService) Get

func (s *FakeFailureService) Get(ctx context.Context, spec Spec) (interface{}, error)

Get returns fake failure.

type FakeNotFoundService

type FakeNotFoundService struct {
}

FakeNotFoundService generic service which always returns not found

func (*FakeNotFoundService) CreateOrUpdate

func (s *FakeNotFoundService) CreateOrUpdate(ctx context.Context, spec Spec) error

CreateOrUpdate returns fake not found.

func (*FakeNotFoundService) Delete

func (s *FakeNotFoundService) Delete(ctx context.Context, spec Spec) error

Delete returns fake not found.

func (*FakeNotFoundService) Get

func (s *FakeNotFoundService) Get(ctx context.Context, spec Spec) (interface{}, error)

Get returns fake not found.

type FakeStruct

type FakeStruct struct {
}

FakeStruct fakes return for Get

type FakeSuccessService

type FakeSuccessService struct {
}

FakeSuccessService generic service which always returns success.

func (*FakeSuccessService) CreateOrUpdate

func (s *FakeSuccessService) CreateOrUpdate(ctx context.Context, spec Spec) error

CreateOrUpdate returns fake success.

func (*FakeSuccessService) Delete

func (s *FakeSuccessService) Delete(ctx context.Context, spec Spec) error

Delete returns fake success.

func (*FakeSuccessService) Get

func (s *FakeSuccessService) Get(ctx context.Context, spec Spec) (interface{}, error)

Get returns fake success.

type Service

type Service interface {
	Get(ctx context.Context, spec Spec) (interface{}, error)
	CreateOrUpdate(ctx context.Context, spec Spec) error
	Delete(ctx context.Context, spec Spec) error
}

Service is a generic interface used by components offering a type of service. example: Network service would offer get/createorupdate/delete.

type Spec

type Spec interface {
}

Spec defines a generic interface which all services should conform to

Directories

Path Synopsis
Package mock_azure is a generated GoMock package.
Package mock_azure is a generated GoMock package.
services
resourceskus/mock_resourceskus
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.

Jump to

Keyboard shortcuts

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