Documentation ¶
Index ¶
- type OnDeleteFunc
- type OnIncreaseFunc
- type TestCloudProvider
- func (tcp *TestCloudProvider) AddNode(nodeGroupId string, node *apiv1.Node)
- func (tcp *TestCloudProvider) AddNodeGroup(id string, min int, max int, size int)
- func (tcp *TestCloudProvider) Name() string
- func (tcp *TestCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error)
- func (tcp *TestCloudProvider) NodeGroups() []cloudprovider.NodeGroup
- type TestNodeGroup
- func (tng *TestNodeGroup) Debug() string
- func (tng *TestNodeGroup) DeleteNodes(nodes []*apiv1.Node) error
- func (tng *TestNodeGroup) Id() string
- func (tng *TestNodeGroup) IncreaseSize(delta int) error
- func (tng *TestNodeGroup) MaxSize() int
- func (tng *TestNodeGroup) MinSize() int
- func (tng *TestNodeGroup) Nodes() ([]string, error)
- func (tng *TestNodeGroup) TargetSize() (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OnDeleteFunc ¶
OnDeleteFunc is a function called on cluster
type OnIncreaseFunc ¶
OnIncreaseFunc is a function called on node group increase in TestCloudProvider. First parameter is the NodeGroup id, second is the increase delta.
type TestCloudProvider ¶
TestCloudProvider is a dummy cloud provider to be used in tests.
func NewTestCloudProvider ¶
func NewTestCloudProvider(onIncrease OnIncreaseFunc, onDelete OnDeleteFunc) *TestCloudProvider
NewTestCloudProvider builds new TestCloudProvider
func (*TestCloudProvider) AddNode ¶
func (tcp *TestCloudProvider) AddNode(nodeGroupId string, node *apiv1.Node)
AddNode adds the given node to the group.
func (*TestCloudProvider) AddNodeGroup ¶
func (tcp *TestCloudProvider) AddNodeGroup(id string, min int, max int, size int)
AddNodeGroup adds node group to test cloud provider.
func (*TestCloudProvider) Name ¶
func (tcp *TestCloudProvider) Name() string
Name returns name of the cloud provider.
func (*TestCloudProvider) NodeGroupForNode ¶
func (tcp *TestCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error)
NodeGroupForNode returns the node group for the given node, nil if the node should not be processed by cluster autoscaler, or non-nil error if such occurred.
func (*TestCloudProvider) NodeGroups ¶
func (tcp *TestCloudProvider) NodeGroups() []cloudprovider.NodeGroup
NodeGroups returns all node groups configured for this cloud provider.
type TestNodeGroup ¶
TestNodeGroup is a node group used by TestCloudProvider.
func (*TestNodeGroup) Debug ¶
func (tng *TestNodeGroup) Debug() string
Debug returns a string containing all information regarding this node group.
func (*TestNodeGroup) DeleteNodes ¶
func (tng *TestNodeGroup) DeleteNodes(nodes []*apiv1.Node) error
DeleteNodes deletes nodes from this node group. Error is returned either on failure or if the given node doesn't belong to this node group. This function should wait until node group size is updated.
func (*TestNodeGroup) Id ¶
func (tng *TestNodeGroup) Id() string
Id returns an unique identifier of the node group.
func (*TestNodeGroup) IncreaseSize ¶
func (tng *TestNodeGroup) IncreaseSize(delta int) error
IncreaseSize increases the size of the node group. To delete a node you need to explicitly name it and use DeleteNode. This function should wait until node group size is updated.
func (*TestNodeGroup) MaxSize ¶
func (tng *TestNodeGroup) MaxSize() int
MaxSize returns maximum size of the node group.
func (*TestNodeGroup) MinSize ¶
func (tng *TestNodeGroup) MinSize() int
MinSize returns minimum size of the node group.
func (*TestNodeGroup) Nodes ¶
func (tng *TestNodeGroup) Nodes() ([]string, error)
Nodes returns a list of all nodes that belong to this node group.
func (*TestNodeGroup) TargetSize ¶
func (tng *TestNodeGroup) TargetSize() (int, error)
TargetSize returns the current target size of the node group. It is possible that the number of nodes in Kubernetes is different at the moment but should be equal to Size() once everything stabilizes (new nodes finish startup and registration or removed nodes are deleted completely)