framework

package
v0.0.0-...-2bea37d Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 21 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 HaveEquivalentNodeAffinity

func HaveEquivalentNodeAffinity(expected interface{}) 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() *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)

Types

type PodFactory

type PodFactory struct {
	// contains filtered or unexported fields
}

PodFactory is a builder for v1.Pod objects to be used only in unit tests.

func NewPod

func NewPod() *PodFactory

NewPod returns a new PodFactory to build v1.Pod objects. It is meant to be used only in unit tests.

func (*PodFactory) Build

func (p *PodFactory) Build() v1.Pod

func (*PodFactory) WithAffinity

func (p *PodFactory) WithAffinity(initialAffinity *v1.Affinity) *PodFactory

WithAffinity adds the affinity to the pod. If initialAffinity is not nil, it is used as the initial value of the pod's affinity. Otherwise, the pod's affinity is initialized to an empty affinity if it is nil.

func (*PodFactory) WithContainersImages

func (p *PodFactory) WithContainersImages(images ...string) *PodFactory

func (*PodFactory) WithGenerateName

func (p *PodFactory) WithGenerateName(name string) *PodFactory

func (*PodFactory) WithImagePullSecrets

func (p *PodFactory) WithImagePullSecrets(imagePullSecrets ...string) *PodFactory

func (*PodFactory) WithInitContainersImages

func (p *PodFactory) WithInitContainersImages(images ...string) *PodFactory

func (*PodFactory) WithNamespace

func (p *PodFactory) WithNamespace(namespace string) *PodFactory

func (*PodFactory) WithNodeAffinity

func (p *PodFactory) WithNodeAffinity() *PodFactory

func (*PodFactory) WithNodeSelectorTermsMatchExpressions

func (p *PodFactory) WithNodeSelectorTermsMatchExpressions(
	nodeSelectorTermsMatchExpressions ...[]v1.NodeSelectorRequirement) *PodFactory

func (*PodFactory) WithNodeSelectors

func (p *PodFactory) WithNodeSelectors(kv ...string) *PodFactory

func (*PodFactory) WithRequiredDuringSchedulingIgnoredDuringExecution

func (p *PodFactory) WithRequiredDuringSchedulingIgnoredDuringExecution() *PodFactory

func (*PodFactory) WithSchedulingGates

func (p *PodFactory) WithSchedulingGates(schedulingGates ...string) *PodFactory

Jump to

Keyboard shortcuts

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