Documentation
¶
Overview ¶
Package deployment implements the Deployment observer.
The Deployment observer bridges the Flux CD delivery layer and the BlanketOps deployment model. It watches Flux Kustomization resources — the objects that FluxCD creates and drives to reconcile manifests from the manifests repository onto the target cluster — and feeds their terminal reconciliation outcomes back to the owning Deployment CR.
Responsibility boundary:
- Watch Flux Kustomization resources for Ready condition transitions.
- Resolve the owning Deployment CR via the deployment.blanketops.dev/name label.
- Map the Flux Ready condition to a domain DeploymentPhase.
- Emit Kubernetes events on the owning Deployment CR.
- Delegate final status persistence to the application StatusWriter.
- MUST NOT mutate domain state beyond status writes.
Architecture note: The Deployment CR owns the Flux Kustomization as a child resource — it is created and managed by the Deployment controller (domain layer), not by this observer. This observer exists solely to reflect the Kustomization's reconciliation outcome back up to the parent Deployment CR, completing the GitOps feedback loop: declare → apply → observe → report.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reconciler ¶
type Reconciler struct {
client.Client
// Status persists the final Deployment outcome once a terminal Kustomization
// state is observed.
Status *application.StatusWriter
// Recorder emits Kubernetes events on the owning Deployment resource.
Recorder *events.EventRecorder
}
Reconciler observes Flux Kustomization resources on behalf of the Deployment domain. It translates Flux reconciliation outcomes into Deployment status updates via the application StatusWriter.
func (*Reconciler) Reconcile ¶
Reconcile is invoked by controller-runtime for every Flux Kustomization event. It exits immediately for non-terminal states, resolves the owning Deployment, maps the Flux condition to a domain phase, and writes the final status.
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the Deployment observer with the controller manager.
The observer watches Flux Kustomization resources rather than Deployment CRs. This is intentional — the Kustomization is the object whose Ready condition signals whether GitOps delivery succeeded or failed. Watching the Deployment CR itself would give us no signal about what Flux actually did on the cluster.