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 ¶
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.