helper

package
v0.0.0-...-41e0b01 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WaitInterval time.Duration = 1 * time.Second
	WaitTimeout  time.Duration = 5 * time.Minute
)

Functions

func EnsureAdmissionWebhook

func EnsureAdmissionWebhook(t *testing.T, client versioned.Interface, name string, override autoscalingv1.PodResourceOverride) (current *autoscalingv1.ClusterResourceOverride, changed bool)

func GetClusterResourceOverride

func GetClusterResourceOverride(t *testing.T, client versioned.Interface, name string) *autoscalingv1.ClusterResourceOverride

func GetContainer

func GetContainer(t *testing.T, name string, spec *corev1.PodSpec) corev1.ResourceRequirements

func IsAvailable

func IsAvailable(override *autoscalingv1.ClusterResourceOverride) bool

func IsMatch

func IsMatch(t *testing.T, requirementsWant, requirementsGot corev1.ResourceRequirements)

func MustMatchMemoryAndCPU

func MustMatchMemoryAndCPU(t *testing.T, resourceWant map[string]corev1.ResourceRequirements, specGot *corev1.PodSpec)

func RemoveAdmissionWebhook

func RemoveAdmissionWebhook(t *testing.T, client versioned.Interface, name string)

func Wait

Types

type Client

type Client struct {
	Operator   versioned.Interface
	Kubernetes kubernetes.Interface
}

func NewClient

func NewClient(t *testing.T, config *rest.Config) *Client

type ConditionFunc

type ConditionFunc func(override *autoscalingv1.ClusterResourceOverride) bool

func GetAvailableConditionFunc

func GetAvailableConditionFunc(original *autoscalingv1.ClusterResourceOverride, expectNewResourceVersion bool) ConditionFunc

type Disposer

type Disposer func()

func NewLimitRanges

func NewLimitRanges(t *testing.T, client kubernetes.Interface, namespace string, spec corev1.LimitRangeSpec) (object *corev1.LimitRange, disposer Disposer)

func NewNamespace

func NewNamespace(t *testing.T, client kubernetes.Interface, name string, optIn bool) (ns *corev1.Namespace, disposer Disposer)

func NewPod

func NewPod(t *testing.T, client kubernetes.Interface, namespace string, spec corev1.PodSpec) (pod *corev1.Pod, disposer Disposer)

func NewPodWithResourceRequirement

func NewPodWithResourceRequirement(t *testing.T, client kubernetes.Interface, namespace string, containerName string, requirements corev1.ResourceRequirements) (pod *corev1.Pod, disposer Disposer)

func (Disposer) Dispose

func (d Disposer) Dispose()

type PreCondition

type PreCondition struct {
	Client kubernetes.Interface
}

func (*PreCondition) MustHaveAdmissionRegistrationV1

func (f *PreCondition) MustHaveAdmissionRegistrationV1(t *testing.T)

func (*PreCondition) MustHaveClusterResourceOverrideAdmissionConfiguration

func (f *PreCondition) MustHaveClusterResourceOverrideAdmissionConfiguration(t *testing.T)

Jump to

Keyboard shortcuts

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