Documentation
¶
Overview ¶
Package environment (environment-observer) is the status rollup reconciler for Environment CRs.
It fans in from all composed CR types — Build, GitRepository, Deployment, Route, Package, and ServiceUnit — and aggregates their readiness into a single EnvironmentStatus: phase + per-resource conditions.
It also auto-discovers composed CRs by label and patches their refs back into spec.contract so the Environment stays current without requiring the operator to declare them upfront.
Sole writer to EnvironmentStatus. Spec contract ref patching is additive only. CQRS boundary: this reconciler never touches composed CR specs.
Readiness is per-domain:
- Build → BuildSuccess=True (set by buildrun-observer)
- GitRepository → Ready=True
- Deployment → Ready=True
- Route → Ready=True
- Package → Ready=True
- ServiceUnit → Ready=True
Phase computation:
- All conditions True → ENVIRONMENT_PHASE_READY
- Any condition False → ENVIRONMENT_PHASE_PENDING
- No conditions → ENVIRONMENT_PHASE_PENDING
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reconciler ¶
type Reconciler struct {
client.Client
Recorder *events.EventRecorder
}
Reconciler is the status rollup reconciler for Environment CRs. See the package doc for its fan-in/aggregation responsibility and CQRS boundary.
func (*Reconciler) Reconcile ¶
Reconcile discovers this Environment's composed CRs by label, patches any missing refs into spec.contract, aggregates their readiness conditions, and writes the resulting phase and conditions to status.
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the Environment observer with the controller manager, watching Environment CRs directly and every composed CR type (Build, GitRepository, Deployment, Package, ServiceUnit) indirectly via mapToEnvironment so a change on any of them re-enqueues the owning Environment.