test

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ProviderName = "test"

Variables

This section is empty.

Functions

func BuildFakeClient

func BuildFakeClient(nodes []*apiv1.Node, pods []*apiv1.Pod) (*fake.Clientset, <-chan string)

BuildFakeClient creates a fake client

func BuildTestNode

func BuildTestNode(opts NodeOpts) *apiv1.Node

BuildTestNode creates a node with specified capacity.

func BuildTestNodes

func BuildTestNodes(amount int, opts NodeOpts) []*apiv1.Node

BuildTestNodes creates multiple nodes with the same options

func BuildTestPod

func BuildTestPod(opts PodOpts) *apiv1.Pod

BuildTestPod builds a pod for testing

func BuildTestPods

func BuildTestPods(amount int, opts PodOpts) []*apiv1.Pod

BuildTestPods creates multiple pods with the same options

func NameFromChan

func NameFromChan(c <-chan string, timeout time.Duration) string

NameFromChan returns a name from a channel update fails if timeout

func NewTestNodeWatcher

func NewTestNodeWatcher(nodes []*v1.Node, opts NodeListerOptions) listerv1.NodeLister

func NewTestPodWatcher

func NewTestPodWatcher(pods []*v1.Pod, opts PodListerOptions) listerv1.PodLister

Types

type CloudProvider

type CloudProvider struct {
	// contains filtered or unexported fields
}

cloudProvider implements the CloudProvider interface

func NewCloudProvider

func NewCloudProvider(nodeGroupSize int) *CloudProvider

func (*CloudProvider) GetInstance added in v1.3.0

func (c *CloudProvider) GetInstance(node *v1.Node) (cloudprovider.Instance, error)

func (*CloudProvider) GetNodeGroup

func (c *CloudProvider) GetNodeGroup(id string) (cloudprovider.NodeGroup, bool)

func (*CloudProvider) Name

func (c *CloudProvider) Name() string

func (*CloudProvider) NodeGroups

func (c *CloudProvider) NodeGroups() []cloudprovider.NodeGroup

func (*CloudProvider) Refresh

func (c *CloudProvider) Refresh() error

func (*CloudProvider) RegisterNodeGroup

func (c *CloudProvider) RegisterNodeGroup(nodeGroup *NodeGroup)

func (*CloudProvider) RegisterNodeGroups

func (c *CloudProvider) RegisterNodeGroups(ids ...string) error

type Instance added in v1.3.0

type Instance struct {
	// contains filtered or unexported fields
}

func (Instance) ID added in v1.6.0

func (i Instance) ID() string

func (Instance) InstantiationTime added in v1.3.0

func (i Instance) InstantiationTime() time.Time

type MockAutoscalingService

type MockAutoscalingService struct {
	autoscalingiface.AutoScalingAPI
	*client.Client

	DescribeAutoScalingGroupsOutput *autoscaling.DescribeAutoScalingGroupsOutput
	DescribeAutoScalingGroupsErr    error

	SetDesiredCapacityOutput *autoscaling.SetDesiredCapacityOutput
	SetDesiredCapacityErr    error

	TerminateInstanceInAutoScalingGroupOutput *autoscaling.TerminateInstanceInAutoScalingGroupOutput
	TerminateInstanceInAutoScalingGroupErr    error
}

type MockEc2Service added in v1.3.0

type MockEc2Service struct {
	ec2iface.EC2API
	*client.Client

	DescribeInstancesOutput *ec2.DescribeInstancesOutput
	DescribeInstancesErr    error
}

func (MockEc2Service) DescribeInstances added in v1.3.0

type NodeGroup

type NodeGroup struct {
	// contains filtered or unexported fields
}

func NewNodeGroup

func NewNodeGroup(id string, minSize int64, maxSize int64, targetSize int64) *NodeGroup

func (*NodeGroup) Belongs

func (n *NodeGroup) Belongs(node *v1.Node) bool

func (*NodeGroup) DecreaseTargetSize

func (n *NodeGroup) DecreaseTargetSize(delta int64) error

func (*NodeGroup) DeleteNodes

func (n *NodeGroup) DeleteNodes(nodes ...*v1.Node) error

func (*NodeGroup) ID

func (n *NodeGroup) ID() string

func (*NodeGroup) IncreaseSize

func (n *NodeGroup) IncreaseSize(delta int64) error

func (*NodeGroup) MaxSize

func (n *NodeGroup) MaxSize() int64

func (*NodeGroup) MinSize

func (n *NodeGroup) MinSize() int64

func (*NodeGroup) Nodes

func (n *NodeGroup) Nodes() []string

func (*NodeGroup) Size

func (n *NodeGroup) Size() int64

func (*NodeGroup) String

func (n *NodeGroup) String() string

func (*NodeGroup) TargetSize

func (n *NodeGroup) TargetSize() int64

type NodeListerOptions

type NodeListerOptions struct {
	ReturnErrorOnList bool
}

type NodeOpts

type NodeOpts struct {
	Name       string
	CPU        int64
	Mem        int64
	LabelKey   string
	LabelValue string
	Creation   time.Time
	Tainted    bool
}

NodeOpts minimal options for configuring a node object in testing

type PodListerOptions

type PodListerOptions struct {
	ReturnErrorOnList bool
}

type PodOpts

type PodOpts struct {
	Name              string
	Namespace         string
	CPU               []int64
	Mem               []int64
	NodeSelectorKey   string
	NodeSelectorValue string
	Owner             string
	NodeAffinityKey   string
	NodeAffinityValue string
	NodeName          string
}

PodOpts are options for a pod

Jump to

Keyboard shortcuts

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