expectations

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 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 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 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 ExpectFinalizersRemoved

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

func ExpectFinalizersRemovedFromList added in v0.25.0

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

func ExpectMachineDeployed added in v0.27.1

func ExpectMachineDeployed(ctx context.Context, c client.Client, cluster *state.Cluster, cloudProvider cloudprovider.CloudProvider, m *v1alpha5.Machine) (*v1alpha5.Machine, *v1.Node)

func ExpectMachineDeployedNoNode added in v0.28.0

func ExpectMachineDeployedNoNode(ctx context.Context, c client.Client, cluster *state.Cluster, cloudProvider cloudprovider.CloudProvider, m *v1alpha5.Machine) (*v1alpha5.Machine, error)

func ExpectMachines added in v0.27.1

func ExpectMachines(ctx context.Context, c client.Client) []*v1alpha5.Machine

func ExpectMachinesCascadeDeletion added in v0.27.1

func ExpectMachinesCascadeDeletion(ctx context.Context, c client.Client, machines ...*v1alpha5.Machine)

func ExpectMakeMachinesInitialized added in v0.29.0

func ExpectMakeMachinesInitialized(ctx context.Context, c client.Client, machines ...*v1alpha5.Machine)

func ExpectMakeNodeClaimsInitialized added in v0.31.0

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

func ExpectMakeNodesAndMachinesInitializedAndStateUpdated added in v0.31.0

func ExpectMakeNodesAndMachinesInitializedAndStateUpdated(ctx context.Context, c client.Client, nodeStateController, machineStateController controller.Controller, nodes []*v1.Node, machines []*v1alpha5.Machine)

func ExpectMakeNodesAndNodeClaimsInitializedAndStateUpdated added in v0.31.0

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

func ExpectMakeNodesInitialized added in v0.29.0

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

func ExpectMakeNodesReady added in v0.27.1

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 ExpectManualBindingWithOffset

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

func ExpectNodeClaimDeployed added in v0.31.0

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

func ExpectNodeClaimDeployedNoNode added in v0.31.0

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

func ExpectNodeClaims added in v0.31.0

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

func ExpectNodeClaimsCascadeDeletion added in v0.31.0

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 added in v0.27.1

func ExpectNodes(ctx context.Context, c client.Client) []*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 ExpectOwnerReferenceExists added in v0.24.0

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 ExpectReconcileSucceededWithOffset added in v0.27.1

func ExpectReconcileSucceededWithOffset(offset int, ctx context.Context, reconciler reconcile.Reconciler, key client.ObjectKey) reconcile.Result

func ExpectResources added in v0.22.1

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 ExpectStatusConditionExists added in v0.24.0

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

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

Types

type Binding added in v0.27.1

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

type Bindings added in v0.27.1

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 added in v0.27.1

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