Documentation ¶
Index ¶
- func ExtractPodNames(pods []*apiv1.Pod) []string
- func NewBackoff() backoff.Backoff
- func NewScaleTestAutoscalingContext(options config.AutoscalingOptions, fakeClient kube_client.Interface, ...) (context.AutoscalingContext, error)
- type GroupSizeChange
- type MockAutoprovisioningNodeGroupListProcessor
- type MockAutoprovisioningNodeGroupManager
- func (p *MockAutoprovisioningNodeGroupManager) CleanUp()
- func (p *MockAutoprovisioningNodeGroupManager) CreateNodeGroup(context *context.AutoscalingContext, nodeGroup cloudprovider.NodeGroup) (nodegroups.CreateNodeGroupResult, errors.AutoscalerError)
- func (p *MockAutoprovisioningNodeGroupManager) CreateNodeGroupAsync(context *context.AutoscalingContext, nodeGroup cloudprovider.NodeGroup, ...) (nodegroups.CreateNodeGroupResult, errors.AutoscalerError)
- func (p *MockAutoprovisioningNodeGroupManager) RemoveUnneededNodeGroups(context *context.AutoscalingContext) (removedNodeGroups []cloudprovider.NodeGroup, err error)
- type MockBinpackingLimiter
- func (p *MockBinpackingLimiter) FinalizeBinpacking(context *context.AutoscalingContext, finalOptions []expander.Option)
- func (p *MockBinpackingLimiter) InitBinpacking(context *context.AutoscalingContext, nodeGroups []cloudprovider.NodeGroup)
- func (p *MockBinpackingLimiter) MarkProcessed(context *context.AutoscalingContext, nodegroupId string)
- func (p *MockBinpackingLimiter) StopBinpacking(context *context.AutoscalingContext, evaluatedOptions []expander.Option) bool
- type MockReportingStrategy
- type NodeConfig
- type NodeGroupConfig
- type NodeTemplateConfig
- type PodConfig
- type ScaleTestConfig
- type ScaleTestResults
- type ScaleUpStatusInfo
- type ScaleUpTestConfig
- type ScaleUpTestResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractPodNames ¶
ExtractPodNames extract pod names from a list of pods
func NewScaleTestAutoscalingContext ¶
func NewScaleTestAutoscalingContext( options config.AutoscalingOptions, fakeClient kube_client.Interface, listers kube_util.ListerRegistry, provider cloudprovider.CloudProvider, processorCallbacks processor_callbacks.ProcessorCallbacks, debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter, ) (context.AutoscalingContext, error)
NewScaleTestAutoscalingContext creates a new test autoscaling context for scaling tests.
Types ¶
type GroupSizeChange ¶
GroupSizeChange represents a change in group size
type MockAutoprovisioningNodeGroupListProcessor ¶
MockAutoprovisioningNodeGroupListProcessor is a fake node group list processor to be used in tests
func (*MockAutoprovisioningNodeGroupListProcessor) CleanUp ¶
func (p *MockAutoprovisioningNodeGroupListProcessor) CleanUp()
CleanUp doesn't do anything; it's here to satisfy the interface
func (*MockAutoprovisioningNodeGroupListProcessor) Process ¶
func (p *MockAutoprovisioningNodeGroupListProcessor) Process(context *context.AutoscalingContext, nodeGroups []cloudprovider.NodeGroup, nodeInfos map[string]*framework.NodeInfo, unschedulablePods []*apiv1.Pod, ) ([]cloudprovider.NodeGroup, map[string]*framework.NodeInfo, error)
Process extends the list of node groups
type MockAutoprovisioningNodeGroupManager ¶
MockAutoprovisioningNodeGroupManager is a mock node group manager to be used in tests
func (*MockAutoprovisioningNodeGroupManager) CleanUp ¶
func (p *MockAutoprovisioningNodeGroupManager) CleanUp()
CleanUp doesn't do anything; it's here to satisfy the interface
func (*MockAutoprovisioningNodeGroupManager) CreateNodeGroup ¶
func (p *MockAutoprovisioningNodeGroupManager) CreateNodeGroup(context *context.AutoscalingContext, nodeGroup cloudprovider.NodeGroup) (nodegroups.CreateNodeGroupResult, errors.AutoscalerError)
CreateNodeGroup creates a new node group
func (*MockAutoprovisioningNodeGroupManager) CreateNodeGroupAsync ¶
func (p *MockAutoprovisioningNodeGroupManager) CreateNodeGroupAsync(context *context.AutoscalingContext, nodeGroup cloudprovider.NodeGroup, nodeGroupInitializer nodegroups.AsyncNodeGroupInitializer) (nodegroups.CreateNodeGroupResult, errors.AutoscalerError)
CreateNodeGroupAsync simulates async node group creation. Returns upcoming node groups, never calls initializer.
func (*MockAutoprovisioningNodeGroupManager) RemoveUnneededNodeGroups ¶
func (p *MockAutoprovisioningNodeGroupManager) RemoveUnneededNodeGroups(context *context.AutoscalingContext) (removedNodeGroups []cloudprovider.NodeGroup, err error)
RemoveUnneededNodeGroups removes uneeded node groups
type MockBinpackingLimiter ¶
type MockBinpackingLimiter struct {
// contains filtered or unexported fields
}
MockBinpackingLimiter is a fake BinpackingLimiter to be used in tests.
func (*MockBinpackingLimiter) FinalizeBinpacking ¶
func (p *MockBinpackingLimiter) FinalizeBinpacking(context *context.AutoscalingContext, finalOptions []expander.Option)
FinalizeBinpacking is here to satisfy the interface.
func (*MockBinpackingLimiter) InitBinpacking ¶
func (p *MockBinpackingLimiter) InitBinpacking(context *context.AutoscalingContext, nodeGroups []cloudprovider.NodeGroup)
InitBinpacking initialises the MockBinpackingLimiter and sets requiredExpansionOptions to 1.
func (*MockBinpackingLimiter) MarkProcessed ¶
func (p *MockBinpackingLimiter) MarkProcessed(context *context.AutoscalingContext, nodegroupId string)
MarkProcessed is here to satisfy the interface.
func (*MockBinpackingLimiter) StopBinpacking ¶
func (p *MockBinpackingLimiter) StopBinpacking(context *context.AutoscalingContext, evaluatedOptions []expander.Option) bool
StopBinpacking stops the binpacking early, if we already have requiredExpansionOptions i.e. 1.
type MockReportingStrategy ¶
type MockReportingStrategy struct {
// contains filtered or unexported fields
}
MockReportingStrategy implements expander.Strategy
func NewMockRepotingStrategy ¶
func NewMockRepotingStrategy(t *testing.T, optionToChoose *GroupSizeChange) *MockReportingStrategy
NewMockRepotingStrategy creates an expander strategy with reporting and mocking capabilities.
func (*MockReportingStrategy) BestOption ¶
func (r *MockReportingStrategy) BestOption(options []expander.Option, nodeInfo map[string]*framework.NodeInfo) *expander.Option
BestOption satisfies the Strategy interface. Picks the best option from those passed as an argument. When parameter optionToChoose is defined, it's picked as the best one. Otherwise, random option is used.
func (*MockReportingStrategy) LastInputOptions ¶
func (r *MockReportingStrategy) LastInputOptions() []GroupSizeChange
LastInputOptions provides access to expansion options passed as an input in recent strategy execution
type NodeConfig ¶
NodeConfig is a node config used in tests
type NodeGroupConfig ¶
NodeGroupConfig is a node group config used in tests
type NodeTemplateConfig ¶
type NodeTemplateConfig struct { MachineType string NodeInfo *framework.NodeInfo NodeGroupName string }
NodeTemplateConfig is a structure to provide node info in tests
type PodConfig ¶
type PodConfig struct { Name string Cpu int64 Memory int64 Gpu int64 Node string ToleratesGpu bool }
PodConfig is a pod config used in tests
type ScaleTestConfig ¶
type ScaleTestConfig struct { Nodes []NodeConfig Pods []PodConfig ExtraPods []PodConfig Options config.AutoscalingOptions NodeDeletionTracker *deletiontracker.NodeDeletionTracker ExpansionOptionToChoose GroupSizeChange // this will be selected by assertingStrategy.BestOption ExpectedScaleDowns []string ExpectedScaleDownCount int }
ScaleTestConfig represents a config of a scale test
type ScaleTestResults ¶
type ScaleTestResults struct { ExpansionOptions []GroupSizeChange GroupTargetSizes map[string]int FinalOption GroupSizeChange NoScaleUpReason string FinalScaleDowns []string Events []string ScaleUpStatus ScaleUpStatusInfo }
ScaleTestResults contains results of a scale test
type ScaleUpStatusInfo ¶
type ScaleUpStatusInfo struct { Result status.ScaleUpResult PodsTriggeredScaleUp []string PodsRemainUnschedulable []string PodsAwaitEvaluation []string }
ScaleUpStatusInfo is a simplified form of a ScaleUpStatus, to avoid mocking actual NodeGroup and Pod objects in test config.
func (*ScaleUpStatusInfo) WasSuccessful ¶
func (s *ScaleUpStatusInfo) WasSuccessful() bool
WasSuccessful returns true iff scale up was successful
type ScaleUpTestConfig ¶
type ScaleUpTestConfig struct { Groups []NodeGroupConfig Nodes []NodeConfig Pods []PodConfig ExtraPods []PodConfig OnScaleUp testcloudprovider.OnScaleUpFunc OnCreateGroup testcloudprovider.OnNodeGroupCreateFunc ExpansionOptionToChoose *GroupSizeChange Options *config.AutoscalingOptions NodeTemplateConfigs map[string]*NodeTemplateConfig EnableAutoprovisioning bool AllOrNothing bool }
ScaleUpTestConfig represents a config of a scale test
type ScaleUpTestResult ¶
type ScaleUpTestResult struct { ScaleUpError errors.AutoscalerError ScaleUpStatus ScaleUpStatusInfo GroupSizeChanges []GroupSizeChange ExpansionOptions []GroupSizeChange Events []string GroupTargetSizes map[string]int }
ScaleUpTestResult represents a node groups scale up result