controller

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConditionTypeValid is the condition type for LynqForm validation status
	ConditionTypeValid = "Valid"
	// ConditionTypeApplied is the condition type for LynqForm applied status
	ConditionTypeApplied = "Applied"
)
View Source
const (
	// Annotation key for tracking Once creation policy
	AnnotationCreatedOnce = "lynq.sh/created-once"
	// Annotation value for created resources
	AnnotationValueTrue = "true"

	// Finalizer for node cleanup
	LynqNodeFinalizer = "lynqnode.operator.lynq.sh/finalizer"

	// Condition types
	ConditionTypeReady       = "Ready"
	ConditionTypeProgressing = "Progressing"
	ConditionTypeConflicted  = "Conflicted"
	ConditionTypeDegraded    = "Degraded"

	// Resource formatting
	NoResourcesMessage = "no resources"

	// Ready reasons
	ReasonResourcesFailedAndConflicted = "ResourcesFailedAndConflicted"
	ReasonResourcesConflicted          = "ResourcesConflicted"
	ReasonResourcesFailed              = "ResourcesFailed"
	ReasonNotAllResourcesReady         = "NotAllResourcesReady"

	// Degraded reasons
	ReasonResourceFailuresAndConflicts = "ResourceFailuresAndConflicts"
	ReasonResourceFailures             = "ResourceFailures"
	ReasonResourceConflicts            = "ResourceConflicts"
	ReasonResourcesNotReady            = "ResourcesNotReady"

	// Reconcile results
	ResultSuccess        = "success"
	ResultPartialFailure = "partial_failure"
)
View Source
const (
	// Finalizer for LynqHub
	FinalizerLynqHub = "lynq.sh/hub-finalizer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LynqFormReconciler

type LynqFormReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

LynqFormReconciler reconciles a LynqForm object

func (*LynqFormReconciler) Reconcile

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

Reconcile validates a LynqForm and checks node statuses

func (*LynqFormReconciler) SetupWithManager

func (r *LynqFormReconciler) SetupWithManager(mgr ctrl.Manager, concurrency int) error

SetupWithManager sets up the controller with the Manager.

type LynqHubReconciler

type LynqHubReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

LynqHubReconciler reconciles a LynqHub object

func (*LynqHubReconciler) Reconcile

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

Reconcile syncs nodes from external data source to Kubernetes

func (*LynqHubReconciler) SetupWithManager

func (r *LynqHubReconciler) SetupWithManager(mgr ctrl.Manager, concurrency int) error

SetupWithManager sets up the controller with the Manager.

type LynqNodeReconciler

type LynqNodeReconciler struct {
	client.Client
	Scheme        *runtime.Scheme
	Recorder      record.EventRecorder
	StatusManager *status.Manager
}

LynqNodeReconciler reconciles a LynqNode object

func (*LynqNodeReconciler) Reconcile

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

Reconcile applies all resources for a node

func (*LynqNodeReconciler) SetupWithManager

func (r *LynqNodeReconciler) SetupWithManager(mgr ctrl.Manager, concurrency int) error

SetupWithManager sets up the controller with the Manager.

type LynqNodeStatusUpdate

type LynqNodeStatusUpdate struct {
	// Resource counts
	DesiredResources    int32
	ReadyResources      int32
	FailedResources     int32
	ConflictedResources int32

	// Applied resource tracking
	AppliedResources []string

	// Computed conditions
	Conditions []metav1.Condition

	// Flags for internal use
	IsReady    bool
	IsDegraded bool
}

LynqNodeStatusUpdate contains all calculated status fields for a LynqNode This structure consolidates status calculation logic for better testability and maintainability

type ReconcileType

type ReconcileType int

ReconcileType defines the type of reconciliation to perform

const (
	ReconcileTypeUnknown ReconcileType = iota
	ReconcileTypeInit                  // Finalizer needs to be added
	ReconcileTypeCleanup               // Handle deletion
	ReconcileTypeSpec                  // Spec changed (full reconcile with apply)
	ReconcileTypeStatus                // Status-only (fast path, no apply)
)

Jump to

Keyboard shortcuts

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