ComponentVersion Controller Documentation¶
Overview¶
The ComponentVersion controller manages the deletion-protection finalizer on the Component referenced by each ComponentVersion. It prevents a Component from being deleted while one or more ComponentVersions still reference it.
Architecture¶
flowchart TD
subgraph Kubernetes
Ctrl[ComponentVersion Controller]
CV[ComponentVersion]
Comp[Component]
end
Ctrl -->|reconciles| CV
CV -->|spec.componentRef| Comp
Ctrl -->|adds/removes componentRefFinalizer| Comp
Hold "Alt" / "Option" to enable pan & zoom
Finalizers¶
| Finalizer | On resource | Purpose |
|---|---|---|
solar.opendefense.cloud/componentversion-finalizer |
ComponentVersion | Allows the controller to observe deletion and run cleanup logic before the object is garbage-collected |
solar.opendefense.cloud/component-ref |
Component | Prevents deletion of the referenced Component while any ComponentVersion references it |
On deletion, the controller:
- Checks whether any other active ComponentVersion in the same namespace still references the same Component.
- If none remain, removes
solar.opendefense.cloud/component-reffrom the Component. - Removes
solar.opendefense.cloud/componentversion-finalizerfrom the ComponentVersion, allowing it to be garbage-collected.
Watch Triggers¶
The ComponentVersion controller is triggered when:
- A
ComponentVersionresource is created, updated, or deleted.
Relationship to Other Controllers¶
flowchart LR
CVCtrl[ComponentVersion Controller] -->|protects| Component
Release -->|references| ComponentVersion
ReleaseCtrl[Release Controller] -->|protects| ComponentVersion
Hold "Alt" / "Option" to enable pan & zoom
ComponentVersions are themselves protected from deletion by the Release controller — a ComponentVersion cannot be deleted while a Release references it. Once the last Release is removed, the ComponentVersion can be deleted, which in turn unblocks Component deletion if no other ComponentVersions exist.