test

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LinodeNodeClass

func LinodeNodeClass(overrides ...v1.LinodeNodeClass) *v1.LinodeNodeClass

func LinodeNodeClassWithoutLKE

func LinodeNodeClassWithoutLKE(overrides ...v1.LinodeNodeClass) *v1.LinodeNodeClass

LinodeNodeClassWithoutLKE creates a LinodeNodeClass configured for direct Linode instance tests. The mode (LKE vs instance) is controlled by the startup flag, not this nodeclass. This helper sets up appropriate defaults for instance mode testing (e.g., Image field).

func Options

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

Types

type Environment

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

	// API
	LinodeAPI *fake.LinodeClient

	// Cache
	LinodeCache               *cache.Cache
	InstanceTypeCache         *cache.Cache
	InstanceCache             *cache.Cache
	OfferingCache             *cache.Cache
	NodePoolCache             *cache.Cache
	UnavailableOfferingsCache *linodecache.UnavailableOfferings
	ValidationCache           *cache.Cache

	// Providers
	InstanceTypesProvider *instancetype.DefaultProvider
	InstanceProvider      *instance.DefaultProvider
	InstanceTypesResolver *instancetype.DefaultResolver
	LKENodeProvider       *lke.DefaultProvider
}

func NewEnvironment

func NewEnvironment(ctx context.Context) *Environment

func (*Environment) NodeProvider

func (env *Environment) NodeProvider(ctx context.Context) instance.Provider

NodeProvider returns the appropriate provider based on the mode in context. For tests that need a specific provider, use InstanceProvider or LKENodeProvider directly.

func (*Environment) Reset

func (env *Environment) Reset()

type OptionsFields

type OptionsFields struct {
	ClusterName             *string
	ClusterEndpoint         *string
	ClusterRegion           *string
	VMMemoryOverheadPercent *float64
	Mode                    *string
}

type TestNodeClass

type TestNodeClass struct {
	v1.LinodeNodeClass
}

Jump to

Keyboard shortcuts

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