controller

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleAppReconciler

type SimpleAppReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Version  string
	Recorder events.EventRecorder
}

SimpleAppReconciler reconciles a SimpleApp object. It ensures that the underlying Deployment, optional Service, and optional PersistentVolumeClaim match the desired state defined in the SimpleApp CR.

The controller is intentionally kept thin: it orchestrates the reconciliation flow, while the actual resource synchronization logic resides in internal/simpleapp/.

func (*SimpleAppReconciler) Reconcile

func (r *SimpleAppReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is the main loop for the controller. It implements level-triggered reconciliation: Fetch -> Sync Resources -> Status Update.

Deletion is handled entirely by Kubernetes garbage collection: all child resources are created with OwnerReferences pointing to the SimpleApp, so they are automatically cascade-deleted when the SimpleApp is removed. No finalizer is needed.

func (*SimpleAppReconciler) SetupWithManager

func (r *SimpleAppReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager registers the controller with the Manager and defines watches.

Jump to

Keyboard shortcuts

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