app

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package app provides a sample controller demonstrating data extraction and guards.

Index

Constants

This section is empty.

Variables

View Source
var AddToScheme = sharedapp.AddToScheme

AddToScheme registers the ExampleApp types with the given scheme.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	client.Client
	Scheme        *runtime.Scheme
	EventRecorder events.EventRecorder
	Metrics       component.MetricsRecorder
	// APIReader reads straight from the API server; FlushStatus uses it on a
	// conflict so the retry sees the live owner rather than a stale cache entry.
	APIReader client.Reader

	// NewConfigMapResource builds the ConfigMap and declares the extraction
	// that writes the dbHost cell.
	NewConfigMapResource func(owner *ExampleApp, dbHost *concepts.Data[string]) (component.Resource, error)

	// NewSecretResource builds the Secret with a data guard and a mutation
	// that read the dbHost cell.
	NewSecretResource func(owner *ExampleApp, dbHost *concepts.Data[string]) (component.Resource, error)
}

Controller reconciles an ExampleApp by managing a ConfigMap and a Secret within a single component. The ConfigMap exposes data via a declared extraction, and the Secret is guarded until that data is available.

func (*Controller) BuildComponent added in v0.16.0

func (r *Controller) BuildComponent(owner *ExampleApp) (*component.Component, *concepts.Data[string], error)

BuildComponent assembles the database component: a ConfigMap registered before a Secret, both wired to a shared data cell. The ConfigMap's declared extraction writes the cell; the Secret's data guard and mutation read it. Build() verifies the ordering. The cell is returned so tests can seed it when rendering cluster-free previews and assert the declared topology.

func (*Controller) Reconcile

func (r *Controller) Reconcile(ctx context.Context, owner *ExampleApp) (err error)

Reconcile builds and reconciles a component where the ConfigMap is registered before the Secret. Registration order matters: the guard on the Secret can only read data extracted by a preceding resource.

type ExampleApp

type ExampleApp = sharedapp.ExampleApp

ExampleApp re-exports the shared CRD type so callers in this package need no import alias.

type ExampleAppList

type ExampleAppList = sharedapp.ExampleAppList

ExampleAppList re-exports the shared list type.

type ExampleAppSpec

type ExampleAppSpec = sharedapp.ExampleAppSpec

ExampleAppSpec re-exports the shared spec type.

type ExampleAppStatus

type ExampleAppStatus = sharedapp.ExampleAppStatus

ExampleAppStatus re-exports the shared status type.

Jump to

Keyboard shortcuts

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