expectations

package
v1.7.1-test.batching Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0, Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndDrain

func CreateAndDrain(
	ctx context.Context,
	cp corecloudprovider.CloudProvider,
	azureEnv *test.Environment,
	nodeClaim *karpv1.NodeClaim,
) (*karpv1.NodeClaim, error)

CreateAndDrain calls cloudProvider.Create and waits for async polling goroutines to complete. It sets the Launched condition on the NodeClaim (mirroring what the core lifecycle controller does in production) so that the async goroutine's waitUntilLaunched unblocks. Returns the created NodeClaim and any error from the Create operation.

Use this instead of direct cloudProvider.Create() calls in tests.

func ExpectCSENotProvisioned added in v1.5.0

func ExpectCSENotProvisioned(env *test.Environment)

func ExpectCSEProvisioned added in v1.5.0

func ExpectCSEProvisioned(env *test.Environment) armcompute.VirtualMachineExtension

func ExpectCleanUp added in v1.4.0

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

ExpectCleanUp handled the cleanup of all Objects we need within testing that core does not

Core's ExpectCleanedUp function does not currently cleanup ConfigMaps: https://github.com/kubernetes-sigs/karpenter/blob/db8df23ffb0b689b116d99597316612c98d382ab/pkg/test/expectations/expectations.go#L244 TODO: surface this within core and remove this function

func ExpectDecodedCustomData added in v0.5.5

func ExpectDecodedCustomData(env *test.Environment) string

func ExpectInstanceResourcesHaveTags added in v1.6.2

func ExpectInstanceResourcesHaveTags(ctx context.Context, name string, azureEnv *test.Environment, tags map[string]*string) *armcompute.VirtualMachine

func ExpectKubeletFlags added in v0.6.0

func ExpectKubeletFlags(_ *test.Environment, customData string, expectedFlags map[string]string)

func ExpectLaunched added in v1.7.0

func ExpectLaunched(ctx context.Context, c client.Client, cloudProvider corecloudprovider.CloudProvider, provisioner *provisioning.Provisioner, pods ...*corev1.Pod)

TODO: Upstream this?

func ExpectProvisionedAndDrained

func ExpectProvisionedAndDrained(
	ctx context.Context,
	c client.Client,
	cluster *state.Cluster,
	cp corecloudprovider.CloudProvider,
	provisioner *provisioning.Provisioner,
	azureEnv *test.Environment,
	pods ...*corev1.Pod,
)

ExpectProvisionedAndDrained provisions pods and waits for async polling goroutines to complete. This ensures that any background Create operations (including GET poller) finish before the test continues, preventing goroutines from interfering with subsequent assertions.

Use this instead of upstream ExpectProvisioned to ensure proper async cleanup.

func ExpectUnavailable

func ExpectUnavailable(env *test.Environment, sku *skewer.SKU, zone string, capacityType string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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