• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

opendefensecloud / solution-arsenal / 32231631735
80%

Build:
DEFAULT BRANCH: main
Ran 19 Aug 2026 08:37AM UTC
Jobs 1
Files 89
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Aug 2026 08:14AM UTC coverage: 80.39% (+0.06%) from 80.329%
32231631735

push

github

web-flow
feat(controller): own Component lifecycle in a per-Component reconciler (#745)

## What

- adds a `ComponentReconciler`
(`pkg/controller/component_controller.go`) that owns the Component
lifecycle: keeps `componentRefFinalizer` in sync with live
ComponentVersions and garbage-collects the Component once the last live
CV is gone

## Why

Component finalize-and-delete is currently split across two writers: the
CV controller manages the protection finalizer, the apiwriter infers the
GC trigger out-of-band -> "count CVs, act on the Component" is not
atomic and re-creation races can orphan or flap the Component. A
per-Component reconciler serializes the count-then-act decision per
object and gives the lifecycle a single owner. Full background in the
issue.

Deletion protection from #621 stays user-visible identical: `kubectl
delete component X` is still blocked while live CVs exist.

Closes #646

## Testing

Whole controller suite (envtest, incl. the 5 new specs for protection,
GC, re-creation race, no-CV preservation):

```
$ make test testargs="pkg/controller"
Ran 140 of 140 Specs in 141.098 seconds
SUCCESS! -- 140 Passed | 0 Failed | 0 Pending | 0 Skipped
```

Focused new specs re-ran clean multiple times, `go build ./... && go vet
./...` clean, `make manifests` regenerated
`charts/solar/files/role.yaml` (components gains `delete`).

## Checklist

- [x] Tests added/updated (5 envtest specs for the new reconciler)
- [x] No breaking changes
- [x] Readable commit history (squashed and cleaned up as desired)
- [x] AI code review considered and comments resolved


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
  - Added automatic cleanup of unreferenced Components.
- Components remain protected while active ComponentVersions reference
them.
  - Added support for watching Component and ComponentVersion changes.

- **Bug Fixes**
  - Deleting a ComponentVersion no longer removes its parent... (continued)

101 of 131 new or added lines in 1 file covered. (77.1%)

4 existing lines in 2 files now uncovered.

5518 of 6864 relevant lines covered (80.39%)

37.93 hits per line

Uncovered Changes

Lines Coverage ∆ File
30
77.1
pkg/controller/component_controller.go

Coverage Regressions

Lines Coverage ∆ File
2
78.26
-0.18% pkg/controller/target_controller.go
2
89.09
-1.82% pkg/discovery/runner.go
Jobs
ID Job ID Ran Files Coverage
1 32231631735.1 19 Aug 2026 08:37AM UTC 89
80.39
GitHub Action Run
Source Files on build 32231631735
  • Tree
  • List 89
  • Changed 6
  • Source Changed 2
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #32231631735
  • 9ac867e1 on github
  • Prev Build on main (#32152534094)
  • Next Build on main (#32238093135)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc