framework

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecorateWithWaitGroup

func DecorateWithWaitGroup(wg *sync.WaitGroup, f func())

func EnsureNamespaces

func EnsureNamespaces(ctx context.Context, client client.Client, namespaces ...string)

func FromEnvTestConfig

func FromEnvTestConfig(cfg *rest.Config) api.Config

func GenerateName added in v1.2.0

func GenerateName() string

func GetClusterMinorVersion added in v1.1.1

func GetClusterMinorVersion(kc kubernetes.Interface) (int, error)

GetClusterMinorVersion returns Kubernetes server minor version (only digits)

func GetEventsForObject added in v1.2.0

func GetEventsForObject(ctx context.Context, client *kubernetes.Clientset, objectName string, objectNamespace string) ([]corev1.Event, error)

func GetImageConfig

func GetImageConfig(ctx context.Context, client runtimeclient.Client) (*ocpconfigv1.Image, error)

func GetImageRepository

func GetImageRepository(image string) string

func GetNodesWithLabel

func GetNodesWithLabel(ctx context.Context, client runtimeclient.Client, labelKey string, labelInValue string) (*corev1.NodeList, error)

func GetPodLog

func GetPodLog(ctx context.Context, clientset *kubernetes.Clientset, namespace, podName, containerName string) (string, error)

func GetPodsWithLabel

func GetPodsWithLabel(ctx context.Context, client runtimeclient.Client, namespace, labelKey, labelInValue string) (*v1.PodList, error)

func GetRandomNodeName

func GetRandomNodeName(ctx context.Context, client runtimeclient.Client, labelKey string, labelInValue string) (string, error)

func GetReplacedImageURI

func GetReplacedImageURI(image, replacedRegistry string) string

func HaveEquivalentNodeAffinity

func HaveEquivalentNodeAffinity(expected interface{}) types.GomegaMatcher

func HaveEquivalentPreferredNodeAffinity

func HaveEquivalentPreferredNodeAffinity(expected *corev1.NodeAffinity) types.GomegaMatcher

func LoadClient

func LoadClient() (client.Client, error)

LoadClient returns a new controller-runtime client.

func LoadClientset

func LoadClientset() (*kubernetes.Clientset, error)

LoadClientset returns a new Kubernetes Clientset.

func NewEphemeralNamespace

func NewEphemeralNamespace(prefix ...string) *corev1.Namespace

func NormalizeNameString

func NormalizeNameString(name string) string

func RegisterScheme

func RegisterScheme(s *runtime.Scheme) error

func StartChannelMonitor

func StartChannelMonitor(ch chan error, descr string)

func StorePodsLog

func StorePodsLog(ctx context.Context, clientset *kubernetes.Clientset, client runtimeclient.Client, namespace, labelKey, labelInValue, containerName, dir string) error

func ValidateCreation

func ValidateCreation(cl client.Client, ctx context.Context, pluginObjectsSet ...PluginObjectsSet) func(gomega.Gomega)

func ValidateCreationWhenObjectsAreMarkedForDeletion added in v1.2.0

func ValidateCreationWhenObjectsAreMarkedForDeletion(cl client.Client, ctx context.Context, pluginObjectsSet ...PluginObjectsSet) func(gomega.Gomega)

func ValidateDeletion

func ValidateDeletion(cl client.Client, ctx context.Context, pluginObjectsSet ...PluginObjectsSet) func(gomega.Gomega)

func VerifyCOAreUpdated

func VerifyCOAreUpdated(g Gomega, ctx context.Context, client runtimeclient.Client, operatorName string)

func VerifyCOAreUpdating

func VerifyCOAreUpdating(g Gomega, ctx context.Context, client runtimeclient.Client, operatorName string)

func VerifyConditions

func VerifyConditions(ctx context.Context, c client.Client, conditionTypeStatusTuples ...ConditionTypeStatusTuple) func(g gomega.Gomega)

func VerifyDaemonSetPodNodeAffinity

func VerifyDaemonSetPodNodeAffinity(ctx context.Context, client runtimeclient.Client, ns *v1.Namespace, labelKey string, labelInValue string, nodeSelectorRequirement *v1.NodeSelectorRequirement) func(g Gomega)

func VerifyDaemonSetPreferredPodNodeAffinity

func VerifyDaemonSetPreferredPodNodeAffinity(ctx context.Context, client runtimeclient.Client, ns *v1.Namespace, labelKey string, labelInValue string, preferredSchedulingTerms []v1.PreferredSchedulingTerm) func(g Gomega)

func VerifyMCPAreUpdated

func VerifyMCPAreUpdated(ctx context.Context, client runtimeclient.Client, poolName string)

func VerifyMCPsAreUpdating

func VerifyMCPsAreUpdating(g Gomega, ctx context.Context, client runtimeclient.Client)

func VerifyPodAnnotations

func VerifyPodAnnotations(ctx context.Context, client runtimeclient.Client, ns *v1.Namespace, labelKey string, labelInValue string, entries map[string]string) func(g Gomega)

func VerifyPodLabels

func VerifyPodLabels(ctx context.Context, client runtimeclient.Client, ns *v1.Namespace, labelKey string, labelInValue string, ifPresent bool, entries map[string]string) func(g Gomega)

func VerifyPodLabelsAreSet

func VerifyPodLabelsAreSet(ctx context.Context, client runtimeclient.Client, ns *v1.Namespace, labelKey string, labelInValue string, labelsKeyValuePair ...string) func(g Gomega)

func VerifyPodNodeAffinity

func VerifyPodNodeAffinity(ctx context.Context, client runtimeclient.Client, ns *v1.Namespace, labelKey string, labelInValue string, nodeSelectorTerms ...v1.NodeSelectorTerm) func(Gomega)

func VerifyPodPreferredNodeAffinity

func VerifyPodPreferredNodeAffinity(ctx context.Context, client runtimeclient.Client, ns *v1.Namespace, labelKey string, labelInValue string, preferredSchedulingTerms []v1.PreferredSchedulingTerm) func(Gomega)

func VerifyPodsAreRunning

func VerifyPodsAreRunning(ctx context.Context, client runtimeclient.Client, ns *v1.Namespace, labelKey string, labelInValue string) func(Gomega)

func VerifyPodsEvents added in v1.2.0

func VerifyPodsEvents(ctx context.Context, client runtimeclient.Client, ns *v1.Namespace, labelKey, labelInValue, eventReason string) func(g Gomega)

func WaitForCOComplete

func WaitForCOComplete(ctx context.Context, client runtimeclient.Client, operatorName string)

func WaitForMCPComplete

func WaitForMCPComplete(ctx context.Context, client runtimeclient.Client)

func WriteToFile

func WriteToFile(dir, fileName, content string) error

Types

type ConditionTypeStatusTuple

type ConditionTypeStatusTuple struct {
	ConditionType   string
	ConditionStatus corev1.ConditionStatus
}

func NewConditionTypeStatusTuple

func NewConditionTypeStatusTuple(conditionType string, conditionStatus corev1.ConditionStatus) ConditionTypeStatusTuple

type PluginObjectsSet added in v1.2.0

type PluginObjectsSet int
const (
	// MainPlugin checks the core pod placement resources.
	MainPlugin PluginObjectsSet = iota
	// ENoExecPlugin checks the ENoExecEvent resources.
	ENoExecPlugin
	EnoExecPluginDeployment
	EnoExecPluginDeploymentObjects
	EnoExecPluginDaemonSet
)

Jump to

Keyboard shortcuts

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