Documentation
¶
Overview ¶
Package testutils is used for unit-tests
Index ¶
- func EventsForObjFn(ctx context.Context, c client.Client, objUID types.UID) func() []string
- func GetReadyConditionReasonForFn(ctx context.Context, c client.Client, ok client.ObjectKey) func() string
- func GetTestNodeMaintenance(name, nodeName, requestorID, reason string) *maintenancev1.NodeMaintenance
- func GetTestNodes(nodePrefix string, numOfNodes int, unschedulable bool) []*corev1.Node
- func GetTestPod(name, nodeName string, labels map[string]string) *corev1.Pod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventsForObjFn ¶
EventsForObjFn returns returns a function that when called it returns Event messages for NodeMaintenance to be used in Tests e.g in Eventually() or Consistently() blocks.
func GetReadyConditionReasonForFn ¶
func GetReadyConditionReasonForFn(ctx context.Context, c client.Client, ok client.ObjectKey) func() string
GetReadyConditionReasonForFn returns a function that when called it returns NodeMaintenance Ready condition Reason to be used in Tests e.g in Eventually() or Consistently() blocks.
func GetTestNodeMaintenance ¶
func GetTestNodeMaintenance(name, nodeName, requestorID, reason string) *maintenancev1.NodeMaintenance
GetTestNodeMaintenance used to create NodeMaintenance object for tests
func GetTestNodes ¶
GetTestNodes used to create node objects for testing controllers
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.