test

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 38 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableCapacityReservationIDValidation added in v1.3.0

func DisableCapacityReservationIDValidation(crds []*apiextensionsv1.CustomResourceDefinition) []*apiextensionsv1.CustomResourceDefinition

DisableCapacityReservationIDValidation updates the regex validation used for capacity reservation IDs to allow any string after the "cr-" prefix. This enables us to embed useful debugging information in the reservation ID, such as the instance type and zone.

func EC2Instance added in v1.12.1

func EC2Instance(overrides ...ec2types.Instance) ec2types.Instance

EC2Instance creates an ec2types.Instance with sensible defaults for testing. Defaults: auto-generated instance ID, running state, m5.large, default region zone, and a private DNS name. Pass overrides to customize any fields. Tags are not defaulted since their presence/absence is intentional in tests.

func EC2NodeClass

func EC2NodeClass(overrides ...v1.EC2NodeClass) *v1.EC2NodeClass

func GetSubnetsFromZone added in v1.13.0

func GetSubnetsFromZone(zone string, zoneInfo []v1.ZoneInfo) []string

func NodeClaimInstanceIDFieldIndexer added in v1.3.0

func NodeClaimInstanceIDFieldIndexer(ctx context.Context) func(ctrlcache.Cache) error

func NodeInstanceIDFieldIndexer added in v1.3.0

func NodeInstanceIDFieldIndexer(ctx context.Context) func(ctrlcache.Cache) error

func Options

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

func RemoveNodeClassTagValidation added in v1.2.0

Types

type Environment

type Environment struct {
	// Mock
	Clock             *clock.FakeClock
	EventRecorder     *coretest.EventRecorder
	InstanceTypeStore *nodeoverlay.InstanceTypeStore

	// API
	EC2API           *fake.EC2API
	EKSAPI           *fake.EKSAPI
	SSMAPI           *fake.SSMAPI
	IAMAPI           *fake.IAMAPI
	PricingAPI       *fake.PricingAPI
	ARCZonalShiftAPI *fake.ARCZonalShiftAPI

	// Cache
	AMICache                             *cache.Cache
	EC2Cache                             *cache.Cache
	InstanceTypeCache                    *cache.Cache
	InstanceCache                        *cache.Cache
	OfferingCache                        *cache.Cache
	UnavailableOfferingsCache            *awscache.UnavailableOfferings
	LaunchTemplateCache                  *cache.Cache
	SubnetCache                          *cache.Cache
	AvailableIPAdressCache               *cache.Cache
	SecurityGroupCache                   *cache.Cache
	InstanceProfileCache                 *cache.Cache
	RoleCache                            *cache.Cache
	SSMCache                             *cache.Cache
	DiscoveredCapacityCache              *cache.Cache
	CapacityReservationCache             *cache.Cache
	CapacityReservationAvailabilityCache *cache.Cache
	PlacementGroupCache                  *cache.Cache
	ValidationCache                      *cache.Cache
	RecreationCache                      *cache.Cache
	ProtectedProfilesCache               *cache.Cache

	// Providers
	CapacityReservationProvider *capacityreservation.DefaultProvider
	PlacementGroupProvider      *placementgroup.DefaultProvider
	InstanceTypesResolver       *instancetype.DefaultResolver
	InstanceTypesProvider       *instancetype.DefaultProvider
	InstanceProvider            *instance.DefaultProvider
	InstanceStatusProvider      *instancestatus.DefaultProvider
	SubnetProvider              *subnet.DefaultProvider
	SecurityGroupProvider       *securitygroup.DefaultProvider
	InstanceProfileProvider     *instanceprofile.DefaultProvider
	PricingProvider             *pricing.DefaultProvider
	AMIProvider                 *amifamily.DefaultProvider
	AMIResolver                 *amifamily.DefaultResolver
	VersionProvider             *version.DefaultProvider
	LaunchTemplateProvider      *launchtemplate.DefaultProvider
	SSMProvider                 *ssmp.DefaultProvider
	ZonalShiftProvider          *arczonalshift.DefaultProvider
}

func NewEnvironment

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

func (*Environment) Reset

func (env *Environment) Reset()

type OptionsFields

type OptionsFields struct {
	ClusterCABundle         *string
	ClusterName             *string
	ClusterEndpoint         *string
	IsolatedVPC             *bool
	EKSControlPlane         *bool
	VMMemoryOverheadPercent *float64
	InterruptionQueue       *string
	ReservedENIs            *int
	DisableDryRun           *bool
	AMIRefreshInterval      *time.Duration
	SubnetRefreshInterval   *time.Duration
}

type TestNodeClass added in v1.1.0

type TestNodeClass struct {
	v1.EC2NodeClass
}

func (*TestNodeClass) InstanceProfileTags added in v1.1.0

func (t *TestNodeClass) InstanceProfileTags(clusterName string) map[string]string

Jump to

Keyboard shortcuts

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