controller

package
v1.5.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 32 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

	// NewHarborClient defaults to harbor.NewClient when unset; tests substitute a
	// fake so reconciliation can run without a Harbor server.
	NewHarborClient func(baseURL, username, password string) harbor.Client
}

WorkspaceReconciler reconciles a Workspace object.

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

func (*WorkspaceReconciler) Reconcile

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

Reconcile runs the level-triggered flow: Fetch -> Domain Sync -> Status Update.

Member-to-label synchronization is handled by the mutating webhook (WorkspaceCustomDefaulter), so labels are consistent before the object reaches etcd.

Deletion needs no finalizer: every child resource carries an OwnerReference to the Workspace, so Kubernetes garbage collection cascades.

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