controller

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorkspaceReconciler

type WorkspaceReconciler struct {
	client.Client
	Scheme       *runtime.Scheme
	Version      string
	Recorder     events.EventRecorder
	HarborClient harbor.Client // nil disables Harbor integration
	HarborURL    string
}

WorkspaceReconciler reconciles a Workspace object. It ensures that the underlying Namespace, RBAC roles, ResourceQuotas, and NetworkPolicies match the desired state defined in the Workspace CR.

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

func (*WorkspaceReconciler) Reconcile

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

Reconcile is the main loop for the controller. It implements the level-triggered reconciliation logic with a thin orchestration pattern: Fetch -> Domain Sync -> Status Update.

Member-to-label synchronization is handled by the Mutating Webhook (WorkspaceCustomDefaulter), ensuring labels are always consistent before the object reaches etcd.

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

func (*WorkspaceReconciler) SetupWithManager

func (r *WorkspaceReconciler) 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