Documentation
¶
Index ¶
- func LinodeNodeClass(overrides ...v1.LinodeNodeClass) *v1.LinodeNodeClass
- func LinodeNodeClassWithoutLKE(overrides ...v1.LinodeNodeClass) *v1.LinodeNodeClass
- func Options(overrides ...OptionsFields) *options.Options
- func StartAsync[T any](ctx context.Context, fn func(context.Context) T) (results <-chan T, cleanup func())
- type Environment
- type OptionsFields
- type TestNodeClass
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
func StartAsync ¶ added in v0.2.0
func StartAsync[T any](ctx context.Context, fn func(context.Context) T) (results <-chan T, cleanup func())
StartAsync runs fn in a goroutine and returns its buffered result channel. Defer cleanup to cancel the operation, discard any unread result, and wait for the goroutine to exit. The operation must honor context cancellation.
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
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()
func (*Environment) SetDefaults ¶ added in v0.1.4
func (env *Environment) SetDefaults()
type OptionsFields ¶
type TestNodeClass ¶
type TestNodeClass struct {
v1.LinodeNodeClass
}