expectations

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 39 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 ...*v1.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 ...*v1beta1.NodeClaim)

func ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated

func ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated(ctx context.Context, c client.Client, nodeStateController, nodeClaimStateController controller.Controller, nodes []*v1.Node, nodeClaims []*v1beta1.NodeClaim)

func ExpectMakeNodesInitialized

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

func ExpectMakeNodesNotReady added in v0.34.0

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

func ExpectMakeNodesReady

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

func ExpectManualBinding

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

func ExpectMetricCounterValue added in v0.35.0

func ExpectMetricCounterValue(metricName string, expectedValue float64, labels map[string]string)

func ExpectMetricGaugeValue added in v0.35.0

func ExpectMetricGaugeValue(metricName string, expectedValue float64, labels map[string]string)

func ExpectNodeClaimDeployed

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

func ExpectNodeClaimDeployedAndStateUpdated added in v0.36.0

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

func ExpectNodeClaimDeployedNoNode

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

func ExpectNodeClaims

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

func ExpectNodeClaimsCascadeDeletion

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

func ExpectNodeExists

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

func ExpectNodes

func ExpectNodes(ctx context.Context, c client.Client) []*v1.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 *v1.Pod) *v1.Pod

func ExpectOwnerReferenceExists

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

func ExpectPodExists

func ExpectPodExists(ctx context.Context, c client.Client, name string, namespace string) *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 ExpectResources

func ExpectResources(expected, real v1.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 *v1.Pod) *v1.Node

func ExpectSkew

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

func ExpectStateNodeExists

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

func ExpectStateNodeExistsForNodeClaim

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

func ExpectStatusConditionExists

func ExpectStatusConditionExists(obj apis.ConditionsAccessor, t apis.ConditionType) apis.Condition

func FindMetricWithLabelValues

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

Types

type Binding

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

type Bindings

type Bindings map[*v1.Pod]*Binding

func ExpectProvisioned

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

func ExpectProvisionedNoBinding

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

func (Bindings) Get

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

Jump to

Keyboard shortcuts

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