Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelArtifactReconciler ¶
type ModelArtifactReconciler struct {
client.Client
Scheme *runtime.Scheme
Version string
KitImage string
Recorder events.EventRecorder
}
ModelArtifactReconciler reconciles a ModelArtifact object. It ensures that the underlying PVC and Job resources match the desired state defined in the ModelArtifact CR.
The controller is intentionally kept thin: it orchestrates the reconciliation flow, while the actual resource construction and status derivation logic reside in internal/artifact/.
func (*ModelArtifactReconciler) Reconcile ¶
func (r *ModelArtifactReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is the main loop for the controller. It implements level-triggered reconciliation: Fetch -> Reconcile Resources -> Status Update.
Deletion is handled entirely by Kubernetes garbage collection: all child resources are created with OwnerReferences pointing to the ModelArtifact, so they are automatically cascade-deleted when the ModelArtifact is removed. No finalizer is needed.
func (*ModelArtifactReconciler) SetupWithManager ¶
func (r *ModelArtifactReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the controller with the Manager and defines watches.
Watch configuration:
- ModelArtifact: with GenerationChangedPredicate to skip status-only updates
- Owned Jobs: status changes automatically trigger re-reconciliation via OwnerReference mapping