Documentation
¶
Index ¶
- func BuildFakeClient(nodes []*corev1.Node, pods []*corev1.Pod) (*fake.Clientset, <-chan string)
- func BuildTestNode(opts NodeOpts) *corev1.Node
- func BuildTestNodes(amount int, opts NodeOpts) []*corev1.Node
- func BuildTestPod(opts PodOpts) *corev1.Pod
- func BuildTestPods(amount int, opts PodOpts) []*corev1.Pod
- func NameFromChan(c <-chan string, timeout time.Duration) string
- func NewTestNodeWatcher(nodes []*v1.Node, opts NodeListerOptions) *nodeLister
- func NewTestPodWatcher(pods []*v1.Pod, opts PodListerOptions) *podLister
- type FlatScenario
- type NodeListerOptions
- type NodeOpts
- type PodListerOptions
- type PodOpts
- type Scenario
- type ScenarioOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFakeClient ¶
BuildFakeClient creates a fake client
func BuildTestNode ¶
BuildTestNode creates a node with specified capacity.
func BuildTestNodes ¶
BuildTestNodes creates multiple nodes with the same options
func BuildTestPod ¶
BuildTestPod builds a pod for testing
func BuildTestPods ¶
BuildTestPods creates multiple pods with the same options
func NameFromChan ¶
NameFromChan returns a name from a channel update fails if timeout
func NewTestNodeWatcher ¶
func NewTestNodeWatcher(nodes []*v1.Node, opts NodeListerOptions) *nodeLister
NewTestNodeWatcher creates a new mock NodeLister with the given nodes and options
func NewTestPodWatcher ¶
func NewTestPodWatcher(pods []*v1.Pod, opts PodListerOptions) *podLister
NewTestPodWatcher creates a new test PodLister with given pods and options
Types ¶
type FlatScenario ¶
type FlatScenario struct { Nodegroups []*atlassianv1.NodeGroup Nodes []*corev1.Node Pods []*corev1.Pod Daemonsets []*appsv1.DaemonSet ControllerRevisions []*appsv1.ControllerRevision }
FlatScenario is a scenario of nodegroups and related components flatted into a single list
func FlattenScenario ¶
func FlattenScenario(scenario *Scenario, includeKeys ...string) *FlatScenario
FlattenScenario turns a Scenario into a FlatScenario
func (*FlatScenario) NodeGroupList ¶
func (f *FlatScenario) NodeGroupList() atlassianv1.NodeGroupList
type NodeListerOptions ¶
type NodeListerOptions struct {
ReturnErrorOnList bool
}
NodeListerOptions options for creating test NodeLister
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
}
PodListerOptions for creating a new test PodLister
type PodOpts ¶
type PodOpts struct { Name string Namespace string CPU []int64 Mem []int64 NodeSelectorKey string NodeSelectorValue string Owner string OwnerName string NodeAffinityKey string NodeAffinityValue string NodeAffinityOp corev1.NodeSelectorOperator NodeName string }
PodOpts are options for a pod
type Scenario ¶
type Scenario struct { Nodegroups map[string]*atlassianv1.NodeGroup Nodes map[string][]*corev1.Node Pods map[string][]*corev1.Pod Daemonsets map[string][]*appsv1.DaemonSet ControllerRevisions map[string][]*appsv1.ControllerRevision }
Scenario is a scenario of nodegroups and related components as a map to list
func BuildTestScenario ¶
func BuildTestScenario(opts ScenarioOpts) *Scenario
BuildTestScenario from a ScenarioOpts
func (*Scenario) Flatten ¶
func (s *Scenario) Flatten() *FlatScenario