Common Spec Fields¶
All Harbor-managed custom resources embed HarborSpecBase. That gives every CR
the same baseline controls for selecting a Harbor instance, handling deletion,
and forcing or scheduling reconciliation. Resource guides focus on
resource-specific behavior and link back here for the shared fields.
For the exact generated schema, defaults, and validation markers, see HarborSpecBase in the API reference.
Shared Fields¶
-
spec.harborConnectionRefSelects the Harbor connection object to use. Setnameand, when needed,kindto choose betweenHarborConnectionandClusterHarborConnection. Thekinddefaults toHarborConnection. When the operator is started with--harbor-connection, this field may be omitted and the operator-wideClusterHarborConnectionis used instead. -
spec.deletionPolicyControls what happens when the Kubernetes object is deleted.Deleteattempts Harbor-side cleanup before removing the finalizer.Orphanskips Harbor-side deletion and removes the finalizer so the Kubernetes object can be deleted immediately. Defaults toDelete. -
spec.driftDetectionIntervalEnables periodic drift checks between the desired state in Kubernetes and the current state in Harbor. If omitted,--default-drift-detection-intervalis used. An explicit value of0disables periodic drift detection even when the operator has a non-zero default. -
spec.reconcileNonceForces an immediate reconcile when the value changes. Use it when you want to trigger a refresh without changing any functional spec fields.
Creation Policy¶
Resources that can uniquely discover an existing Harbor resource expose
spec.creationPolicy:
Createcreates a new resource and reports a conflict if a match already exists.Adoptrequires a matching resource and reports an error instead of creating one when no match exists.CreateOrAdoptadopts a matching resource when present and creates one otherwise.
When spec.creationPolicy is omitted, the operator uses
--default-creation-policy, whose default is Create. An explicit resource
value always takes precedence.
After creation or adoption, the operator fully reconciles the Harbor resource.
spec.deletionPolicy independently controls whether deleting the Kubernetes object
also deletes the managed Harbor resource.