test

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: Apache-2.0, Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCIGImageVersion = "202501.02.0"
	DefaultSIGImageVersion = "202410.09.0"
)
View Source
const (
	// Note (charliedmcb): this already exists in test/pkg/environment/common
	// https://github.com/Azure/karpenter-provider-azure/blob/84e449787ec72268efb0c7af81ec87a6b3ee95fa/test/pkg/environment/common/setup.go#L47
	// However, I'd prefer to keep our unit test dependants self-contained instead of depending upon the e2e testing package.
	TestingFinalizer = "testing/finalizer"
)

Variables

This section is empty.

Functions

func AKSNodeClass

func AKSNodeClass(overrides ...v1beta1.AKSNodeClass) *v1beta1.AKSNodeClass

func AKSNodeClassFieldIndexer added in v0.7.0

func AKSNodeClassFieldIndexer(ctx context.Context) func(cache.Cache) error

func ApplyCIGImages added in v1.4.0

func ApplyCIGImages(nodeClass *v1beta1.AKSNodeClass)

func ApplyCIGImagesWithVersion added in v1.4.0

func ApplyCIGImagesWithVersion(nodeClass *v1beta1.AKSNodeClass, cigImageVersion string)

func ApplyDefaultStatus added in v1.4.0

func ApplyDefaultStatus(nodeClass *v1beta1.AKSNodeClass, env *coretest.Environment)

func ApplySIGImages added in v1.4.0

func ApplySIGImages(nodeClass *v1beta1.AKSNodeClass)

func ApplySIGImagesWithVersion added in v1.4.0

func ApplySIGImagesWithVersion(nodeClass *v1beta1.AKSNodeClass, sigImageVersion string)

func Interface added in v0.6.2

func Interface(overrides ...InterfaceOptions) *armnetwork.Interface

Interface creates a test Azure Network Interface with defaults that can be overridden by InterfaceOptions. Overrides are applied in order, with last-write-wins semantics.

func MakeStandardLoadBalancer

func MakeStandardLoadBalancer(resourceGroup string, lbName string, includeOutbound bool) armnetwork.LoadBalancer

func ManagedTags added in v0.6.2

func ManagedTags(nodepoolName string) map[string]*string

func NodePool

func NodePool(options karpv1.NodePool) *karpv1.NodePool

func Options

func Options(overrides ...OptionsFields) *azoptions.Options

func RandomName added in v0.6.2

func RandomName(prefix string) string

RandomName returns a pseudo-random resource name with a given prefix.

func VirtualMachine added in v0.6.2

func VirtualMachine(overrides ...VirtualMachineOptions) *armcompute.VirtualMachine

VirtualMachine creates a test Azure Virtual Machine with defaults that can be overridden by VirtualMachineOptions. Overrides are applied in order, with last-write-wins semantics.

Types

type Environment

type Environment struct {
	// API
	VirtualMachinesAPI          *fake.VirtualMachinesAPI
	AzureResourceGraphAPI       *fake.AzureResourceGraphAPI
	VirtualMachineExtensionsAPI *fake.VirtualMachineExtensionsAPI
	NetworkInterfacesAPI        *fake.NetworkInterfacesAPI
	CommunityImageVersionsAPI   *fake.CommunityGalleryImageVersionsAPI
	MockSkuClientSingleton      *fake.MockSkuClientSingleton
	PricingAPI                  *fake.PricingAPI
	LoadBalancersAPI            *fake.LoadBalancersAPI

	// Cache
	KubernetesVersionCache    *cache.Cache
	InstanceTypeCache         *cache.Cache
	LoadBalancerCache         *cache.Cache
	UnavailableOfferingsCache *azurecache.UnavailableOfferings

	// Providers
	InstanceTypesProvider  instancetype.Provider
	InstanceProvider       instance.Provider
	PricingProvider        *pricing.Provider
	ImageProvider          *imagefamily.Provider
	ImageResolver          imagefamily.Resolver
	LaunchTemplateProvider *launchtemplate.Provider
	LoadBalancerProvider   *loadbalancer.Provider
	// contains filtered or unexported fields
}

func NewEnvironment

func NewEnvironment(ctx context.Context, env *coretest.Environment) *Environment

func NewEnvironmentNonZonal

func NewEnvironmentNonZonal(ctx context.Context, env *coretest.Environment) *Environment

func NewRegionalEnvironment

func NewRegionalEnvironment(ctx context.Context, env *coretest.Environment, region string, nonZonal bool) *Environment

func (*Environment) Reset

func (env *Environment) Reset()

func (*Environment) Zones

func (env *Environment) Zones() []string

type InterfaceOptions added in v0.6.2

type InterfaceOptions struct {
	Name         string
	NodepoolName string
	Location     string
	Properties   *armnetwork.InterfacePropertiesFormat
	Tags         map[string]*string
}

InterfaceOptions customizes an Azure Network Interface for testing.

type OptionsFields

type OptionsFields struct {
	ClusterName                    *string
	ClusterEndpoint                *string
	ClusterID                      *string
	KubeletClientTLSBootstrapToken *string
	SSHPublicKey                   *string
	NetworkPlugin                  *string
	NetworkPluginMode              *string
	NetworkPolicy                  *string
	NetworkDataplane               *string
	VMMemoryOverheadPercent        *float64
	NodeIdentities                 []string
	SubnetID                       *string
	NodeResourceGroup              *string
	ProvisionMode                  *string
	NodeBootstrappingServerURL     *string
	VnetGUID                       *string
	KubeletIdentityClientID        *string

	// SIG Flags not required by the self hosted offering
	UseSIG                  *bool
	SIGAccessTokenServerURL *string
	SIGAccessTokenScope     *string
	SIGSubscriptionID       *string
}

type VirtualMachineOptions added in v0.6.2

type VirtualMachineOptions struct {
	Name         string
	NodepoolName string
	Location     string
	Properties   *armcompute.VirtualMachineProperties
	Tags         map[string]*string
}

VirtualMachineOptions customizes an Azure Virtual Machine for testing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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