framework

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(t *testing.T, ctx context.Context, cli client.Client, obj client.Object)

Cleanup deletes an object and waits for it to be gone.

func CleanupStep

func CleanupStep(t *testing.T, name string, cli client.Client, objs ...client.Object) flow.Steper

CleanupStep returns a workflow step that cleans up the given objects.

func CreateStep

func CreateStep(t *testing.T, name string, cli client.Client, obj client.Object) flow.Steper

CreateStep returns a workflow step that creates the given object.

func DeleteStep

func DeleteStep(t *testing.T, name string, cli client.Client, obj client.Object) flow.Steper

DeleteStep returns a workflow step that deletes the given object.

func NewClient

func NewClient(t *testing.T) client.Client

NewClient creates a controller-runtime client using the in-cluster or KUBECONFIG config.

func NewComposition

func NewComposition(name, ns string, opts ...CompositionOption) *apiv1.Composition

NewComposition builds a Composition in the given namespace. Use WithSynthesizerRefs to bind it to a Synthesizer.

func NewMinimalSynthesizer

func NewMinimalSynthesizer(name string, opts ...SynthesizerOption) *apiv1.Synthesizer

NewMinimalSynthesizer builds a Synthesizer with sensible defaults. Only the name is required; use WithImage and WithCommand to customise.

func NewSymphony

func NewSymphony(name, ns string, synthNames ...string) *apiv1.Symphony

NewSymphony builds a Symphony with one variation per synthesizer name.

func ToCommand

func ToCommand(objs ...client.Object) []string

ToCommand converts Kubernetes objects into a bash command that echoes them as a KRM ResourceList on stdout — exactly what a synthesizer pod is expected to do. Each object must have its APIVersion and Kind set (e.g. corev1.ConfigMap with its TypeMeta populated, or an unstructured.Unstructured).

func UniqueName

func UniqueName(prefix string) string

UniqueName generates a test-unique resource name with a timestamp suffix.

func WaitForCompositionReady

func WaitForCompositionReady(t *testing.T, ctx context.Context, cli client.Client, key types.NamespacedName, timeout time.Duration)

WaitForCompositionReady polls until the composition's Simplified.Status equals "Ready".

func WaitForCompositionResynthesized

func WaitForCompositionResynthesized(t *testing.T, ctx context.Context, cli client.Client, key types.NamespacedName, minGen int64, timeout time.Duration)

WaitForCompositionResynthesized polls until the composition's ObservedSynthesizerGeneration advances beyond minGen AND status returns to "Ready".

func WaitForResourceDeleted

func WaitForResourceDeleted(t *testing.T, ctx context.Context, cli client.Client, obj client.Object, timeout time.Duration)

WaitForResourceDeleted polls until the given object returns NotFound.

func WaitForResourceExists

func WaitForResourceExists(t *testing.T, ctx context.Context, cli client.Client, obj client.Object, timeout time.Duration)

WaitForResourceExists polls until the given object can be fetched.

func WaitForSymphonyReady

func WaitForSymphonyReady(t *testing.T, ctx context.Context, cli client.Client, key types.NamespacedName, timeout time.Duration)

WaitForSymphonyReady polls until the symphony's Status.Ready is non-nil.

Types

type CompositionOption

type CompositionOption func(*apiv1.CompositionSpec)

CompositionOption configures optional fields on a Composition.

func WithSynthesizerRefs

func WithSynthesizerRefs(ref apiv1.SynthesizerRef) CompositionOption

WithSynthesizerRefs sets the Composition's synthesizer reference.

type SynthesizerOption

type SynthesizerOption func(*apiv1.SynthesizerSpec)

SynthesizerOption configures optional fields on a Synthesizer.

func WithCommand

func WithCommand(cmd []string) SynthesizerOption

WithCommand sets the Synthesizer's command.

func WithImage

func WithImage(image string) SynthesizerOption

WithImage sets the Synthesizer's container image.

Jump to

Keyboard shortcuts

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