Documentation
¶
Index ¶
- func Cleanup(t *testing.T, ctx context.Context, cli client.Client, obj client.Object)
- func CleanupStep(t *testing.T, name string, cli client.Client, objs ...client.Object) flow.Steper
- func CreateStep(t *testing.T, name string, cli client.Client, obj client.Object) flow.Steper
- func DeleteStep(t *testing.T, name string, cli client.Client, obj client.Object) flow.Steper
- func NewClient(t *testing.T) client.Client
- func NewComposition(name, ns string, opts ...CompositionOption) *apiv1.Composition
- func NewMinimalSynthesizer(name string, opts ...SynthesizerOption) *apiv1.Synthesizer
- func NewSymphony(name, ns string, synthNames ...string) *apiv1.Symphony
- func ToCommand(objs ...client.Object) []string
- func UniqueName(prefix string) string
- func WaitForCompositionReady(t *testing.T, ctx context.Context, cli client.Client, key types.NamespacedName, ...)
- func WaitForCompositionResynthesized(t *testing.T, ctx context.Context, cli client.Client, key types.NamespacedName, ...)
- func WaitForResourceDeleted(t *testing.T, ctx context.Context, cli client.Client, obj client.Object, ...)
- func WaitForResourceExists(t *testing.T, ctx context.Context, cli client.Client, obj client.Object, ...)
- func WaitForSymphonyReady(t *testing.T, ctx context.Context, cli client.Client, key types.NamespacedName, ...)
- type CompositionOption
- type SynthesizerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupStep ¶
CleanupStep returns a workflow step that cleans up the given objects.
func CreateStep ¶
CreateStep returns a workflow step that creates the given object.
func DeleteStep ¶
DeleteStep returns a workflow step that deletes the given object.
func NewClient ¶
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 ¶
NewSymphony builds a Symphony with one variation per synthesizer name.
func ToCommand ¶
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 ¶
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.
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.