expectations

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func EventuallyExpectTerminating added in v0.34.0

func EventuallyExpectTerminating(ctx context.Context, c client.Client, objs ...client.Object)

EventuallyExpectTerminating ensures that the deletion timestamp is eventually set

func ExpectApplied

func ExpectApplied(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

func ExpectDeletionTimestampSet(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 ExpectEvicted added in v0.34.0

func ExpectEvicted(ctx context.Context, c client.Client, pods ...*corev1.Pod)

ExpectEvicted triggers an eviction call for all the passed pods

func ExpectExists

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

func ExpectFinalizersRemoved

func ExpectFinalizersRemoved(ctx context.Context, c client.Client, objs ...client.Object)

func ExpectFinalizersRemovedFromList

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

func ExpectMakeNodeClaimsInitialized

func ExpectMakeNodeClaimsInitialized(ctx context.Context, c client.Client, nodeClaims ...*v1.NodeClaim)

func ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated

func ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx context.Context, c client.Client, nodeStateController *informer.NodeController, nodeClaimStateController *informer.NodeClaimController, nodes []*corev1.Node, nodeClaims []*v1.NodeClaim)

func ExpectMakeNodesInitialized

func ExpectMakeNodesInitialized(ctx context.Context, c client.Client, nodes ...*corev1.Node)

func ExpectMakeNodesNotReady added in v0.34.0

func ExpectMakeNodesNotReady(ctx context.Context, c client.Client, nodes ...*corev1.Node)

func ExpectMakeNodesReady

func ExpectMakeNodesReady(ctx context.Context, c client.Client, nodes ...*corev1.Node)

func ExpectManualBinding

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

func ExpectMetricCounterValue added in v0.35.0

func ExpectMetricCounterValue(collector prometheus.Collector, expectedValue float64, labels map[string]string)

func ExpectMetricGaugeValue added in v0.35.0

func ExpectMetricGaugeValue(collector prometheus.Collector, expectedValue float64, labels map[string]string)

func ExpectMetricHistogramSampleCountValue added in v1.0.0

func ExpectMetricHistogramSampleCountValue(metricName string, expectedValue uint64, labels map[string]string)

func ExpectMetricName added in v0.37.0

func ExpectMetricName(collector prometheus.Collector) string

ExpectMetricName attempts to resolve a metric name from a collector. This function will work so long as the fully qualified name is a single metric name. This holds true for the built in types, but may not for custom collectors.

func ExpectNodeClaimDeployed

func ExpectNodeClaimDeployed(ctx context.Context, c client.Client, cloudProvider cloudprovider.CloudProvider, nc *v1.NodeClaim) (*v1.NodeClaim, *corev1.Node, error)

func ExpectNodeClaimDeployedAndStateUpdated added in v0.36.0

func ExpectNodeClaimDeployedAndStateUpdated(ctx context.Context, c client.Client, cluster *state.Cluster, cloudProvider cloudprovider.CloudProvider, nc *v1.NodeClaim) (*v1.NodeClaim, *corev1.Node)

func ExpectNodeClaimDeployedNoNode

func ExpectNodeClaimDeployedNoNode(ctx context.Context, c client.Client, cloudProvider cloudprovider.CloudProvider, nc *v1.NodeClaim) (*v1.NodeClaim, error)

func ExpectNodeClaims

func ExpectNodeClaims(ctx context.Context, c client.Client) []*v1.NodeClaim

func ExpectNodeClaimsCascadeDeletion

func ExpectNodeClaimsCascadeDeletion(ctx context.Context, c client.Client, nodeClaims ...*v1.NodeClaim)

func ExpectNodeExists

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

func ExpectNodes

func ExpectNodes(ctx context.Context, c client.Client) []*corev1.Node

func ExpectNotFound

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

func ExpectNotScheduled

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

func ExpectObjectReconcileFailed added in v0.37.0

func ExpectObjectReconcileFailed[T client.Object](ctx context.Context, c client.Client, reconciler reconcile.ObjectReconciler[T], object T) error

func ExpectObjectReconciled added in v0.37.0

func ExpectObjectReconciled[T client.Object](ctx context.Context, c client.Client, reconciler reconcile.ObjectReconciler[T], object T) reconcile.Result

func ExpectOwnerReferenceExists

func ExpectOwnerReferenceExists(obj, owner client.Object) metav1.OwnerReference

func ExpectPodExists

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

func ExpectReconcileSucceeded

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

func ExpectResources

func ExpectResources(expected, real corev1.ResourceList)

ExpectResources expects all the resources in expected to exist in real with the same values

func ExpectScheduled

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

func ExpectSingletonReconcileFailed added in v1.0.0

func ExpectSingletonReconcileFailed(ctx context.Context, reconciler singleton.Reconciler) error

func ExpectSingletonReconciled added in v1.0.0

func ExpectSingletonReconciled(ctx context.Context, reconciler singleton.Reconciler) reconcile.Result

func ExpectSkew

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

func ExpectStateNodeExists

func ExpectStateNodeExists(cluster *state.Cluster, node *corev1.Node) *state.StateNode

func ExpectStateNodeExistsForNodeClaim

func ExpectStateNodeExistsForNodeClaim(cluster *state.Cluster, nodeClaim *v1.NodeClaim) *state.StateNode

func ExpectStatusConditionExists

func ExpectStatusConditionExists(obj status.Object, t string) status.Condition

func FindMetricWithLabelValues

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

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

Types

type Binding

type Binding struct {
	NodeClaim *v1.NodeClaim
	Node      *corev1.Node
}

type Bindings

type Bindings map[*corev1.Pod]*Binding

func ExpectProvisioned

func ExpectProvisioned(ctx context.Context, c client.Client, cluster *state.Cluster, cloudProvider cloudprovider.CloudProvider, provisioner *provisioning.Provisioner, pods ...*corev1.Pod) Bindings

func ExpectProvisionedNoBinding

func ExpectProvisionedNoBinding(ctx context.Context, c client.Client, cluster *state.Cluster, cloudProvider cloudprovider.CloudProvider, provisioner *provisioning.Provisioner, pods ...*corev1.Pod) Bindings

func (Bindings) Get

func (b Bindings) Get(p *corev1.Pod) *Binding

Jump to

Keyboard shortcuts

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