expectations

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReconcilerPropagationTime = 10 * time.Second
	RequestInterval           = 1 * time.Second
)

Variables

This section is empty.

Functions

func ExpectApplied

func ExpectApplied(ctx context.Context, c client.Client, objects ...client.Object)

func ExpectAppliedWithOffset

func ExpectAppliedWithOffset(offset int, ctx context.Context, c client.Client, objects ...client.Object)

func ExpectCleanedUp

func ExpectCleanedUp(ctx context.Context, c client.Client)

func ExpectDeleted

func ExpectDeleted(ctx context.Context, c client.Client, objects ...client.Object)

func ExpectDeletionTimestampSet added in v0.21.0

func ExpectDeletionTimestampSet(ctx context.Context, c client.Client, objects ...client.Object)

func ExpectDeletionTimestampSetWithOffset added in v0.21.0

func ExpectDeletionTimestampSetWithOffset(offset int, ctx context.Context, c client.Client, objects ...client.Object)

ExpectDeletionTimestampSetWithOffset ensures that the deletion timestamp is set on the objects by adding a finalizer and then deleting the object immediately after. This holds the object until the finalizer is patched out in the DeferCleanup

func ExpectExists

func ExpectExists[T client.Object](ctx context.Context, c client.Client, obj T) T

func ExpectExistsWithOffset

func ExpectExistsWithOffset[T client.Object](offset int, ctx context.Context, c client.Client, obj T) T

func ExpectFinalizersRemoved

func ExpectFinalizersRemoved(ctx context.Context, c client.Client, objectLists ...client.ObjectList)

func ExpectManualBinding

func ExpectManualBinding(ctx context.Context, c client.Client, pod *v1.Pod, node *v1.Node)

func ExpectManualBindingWithOffset

func ExpectManualBindingWithOffset(offset int, ctx context.Context, c client.Client, pod *v1.Pod, node *v1.Node)

func ExpectMetric

func ExpectMetric(prefix string) *prometheus.MetricFamily

func ExpectNodeExists

func ExpectNodeExists(ctx context.Context, c client.Client, name string) *v1.Node

func ExpectNodeExistsWithOffset

func ExpectNodeExistsWithOffset(offset int, ctx context.Context, c client.Client, name string) *v1.Node

func ExpectNotFound

func ExpectNotFound(ctx context.Context, c client.Client, objects ...client.Object)

func ExpectNotFoundWithOffset

func ExpectNotFoundWithOffset(offset int, ctx context.Context, c client.Client, objects ...client.Object)

func ExpectNotScheduled

func ExpectNotScheduled(ctx context.Context, c client.Client, pod *v1.Pod) *v1.Pod

func ExpectPanic

func ExpectPanic()

ExpectPanic is a function that should be deferred at the beginning of a test like "defer ExpectPanic()" It asserts that the test should panic

func ExpectPodExists

func ExpectPodExists(ctx context.Context, c client.Client, name string, namespace string) *v1.Pod

func ExpectPodExistsWithOffset

func ExpectPodExistsWithOffset(offset int, ctx context.Context, c client.Client, name string, namespace string) *v1.Pod

func ExpectProvisioned

func ExpectProvisioned(ctx context.Context, c client.Client, cluster *state.Cluster, recorder *test.EventRecorder, controller corecontroller.Controller,
	provisioner *provisioning.Provisioner, pods ...*v1.Pod) (result []*v1.Pod)

func ExpectProvisionedNoBinding

func ExpectProvisionedNoBinding(ctx context.Context, c client.Client, controller corecontroller.Controller, provisioner *provisioning.Provisioner, pods ...*v1.Pod) (result []*v1.Pod)

func ExpectProvisionedNoBindingWithOffset

func ExpectProvisionedNoBindingWithOffset(offset int, ctx context.Context, c client.Client, controller corecontroller.Controller, provisioner *provisioning.Provisioner, pods ...*v1.Pod) (result []*v1.Pod)

func ExpectReconcileFailed

func ExpectReconcileFailed(ctx context.Context, reconciler reconcile.Reconciler, key client.ObjectKey)

func ExpectReconcileSucceeded

func ExpectReconcileSucceeded(ctx context.Context, reconciler reconcile.Reconciler, key client.ObjectKey) reconcile.Result

func ExpectScheduled

func ExpectScheduled(ctx context.Context, c client.Client, pod *v1.Pod) *v1.Node

func ExpectSkew

func ExpectSkew(ctx context.Context, c client.Client, namespace string, constraint *v1.TopologySpreadConstraint) Assertion

func FindMetricWithLabelValues added in v0.21.0

func FindMetricWithLabelValues(name string, labelValues map[string]string) (*prometheus.Metric, bool)

FindMetricWithLabelValues attempts to find a metric with a name with a set of label values If no metric is found, the *prometheus.Metric will be nil

func GomegaFromContext

func GomegaFromContext(ctx context.Context) Gomega

func GomegaWithContext

func GomegaWithContext(ctx context.Context, g Gomega) context.Context

Types

This section is empty.

Jump to

Keyboard shortcuts

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