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

karellen / kubernator / 24637370495
82%

Build:
DEFAULT BRANCH: master
Ran 19 Apr 2026 08:54PM UTC
Jobs 5
Files 40
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 Apr 2026 07:35PM UTC coverage: 82.036% (+0.04%) from 81.992%
24637370495

push

github

web-flow
Add project plugin v1: scope, ownership, cleanup (#103)

## Summary

Introduces a **project plugin** that adds hierarchical scope, ownership
tracking, and cleanup to Kubernator. Kubernator today is stateless —
every run reconciles everything it discovers and cannot tell whether a
resource it sees was applied by us, by someone else, or by a previous
run that has since dropped the manifest. Project v1 fixes all three:

- **Scope.** A user registers the project plugin once at the root with a
name; sub-directories extend the project via ``ktor.app.project =
\"<segment>\"`` (dot-joined top-down). CLI flags ``-I``/``-X`` scope a
run to specific sub-trees (repeatable, combineable: ``candidates = known
∩ includes`` then ``in_scope = candidates − excludes``).
- **Ownership.** Every applied resource is stamped with a
``kubernator.io/project`` annotation carrying the composed path. A
single gzipped JSON Secret per top-level project
(``<state_namespace>/kubernator-project-<sha1(root)[:12]>``) records the
idents of resources we own.
- **Cleanup.** On each run, the prior Secret's idents are diffed against
the current in-scope manifests; when ``cleanup=True``, resources that
used to be ours but are no longer in scope get deleted. Resources that
moved between sub-projects within the run's in-scope set are detected
and preserved (dedup on identity, ignoring project).

### Crash resilience

The Secret write is two-phase: before ``handle_apply`` runs, the new
intent is recorded as ``pending`` with ``finalized=false`` while
``resources`` still holds the prior finalized set. After
``handle_cleanup`` succeeds, Finalize commits the merged ``resources``
and clears ``pending`` with ``finalized=true``. A crash between the two
phases leaves ``finalized=false``; the next run's cleanup takes the
conservative union (``resources ∪ pending``) so no previously-owned
resource ever slips past cleanup.

### Concurrent-run protection

A ``coordination.k8s.io/v1.Lease`` named
``kubernator... (continued)

1078 of 1494 branches covered (72.16%)

Branch coverage included in aggregate %.

443 of 561 new or added lines in 5 files covered. (78.97%)

3 existing lines in 1 file now uncovered.

4434 of 5225 relevant lines covered (84.86%)

4.23 hits per line

Uncovered Changes

Lines Coverage ∆ File
114
77.64
-2.14% src/main/python/kubernator/plugins/k8s.py
2
74.29
1.55% src/main/python/kubernator/api.py
2
86.75
0.77% src/main/python/kubernator/app.py

Coverage Regressions

Lines Coverage ∆ File
3
74.29
1.55% src/main/python/kubernator/api.py
Jobs
ID Job ID Ran Files Coverage
1 24637370495.1 19 Apr 2026 08:54PM UTC 40
81.59
GitHub Action Run
2 24637370495.2 19 Apr 2026 08:55PM UTC 40
81.96
GitHub Action Run
3 24637370495.3 19 Apr 2026 08:55PM UTC 40
81.59
GitHub Action Run
4 24637370495.4 19 Apr 2026 08:56PM UTC 40
81.59
GitHub Action Run
5 24637370495.5 19 Apr 2026 08:57PM UTC 40
81.59
GitHub Action Run
Source Files on build 24637370495
  • Tree
  • List 40
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • c12b7f35 on github
  • Prev Build on master (#24621395421)
  • Next Build on master (#24678569864)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc