testutils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testutils is used for unit-tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventsForObjFn

func EventsForObjFn(ctx context.Context, c client.Client, objUID types.UID) func() []string

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

func GetTestNodes(nodePrefix string, numOfNodes int, unschedulable bool) []*corev1.Node

GetTestNodes used to create node objects for testing controllers

func GetTestPod

func GetTestPod(name, nodeName string, labels map[string]string) *corev1.Pod

GetTestPod used to create pod objects for tests

Types

This section is empty.

Jump to

Keyboard shortcuts

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