feat(fleet-operator): real dashboard data from kube CRs + NATS KV #322
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/fleet-operator-real-data"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
RealFleetService implements FleetService against the same sources the
reconcile loop owns, read-only:
the aggregator-maintained .status.aggregate (target/healthy/failing/
pending counts, deployment status).
Status, dashboard counts, and alerts (one critical per failing
deployment, one warning per stale device; acks held in-memory) are all
derived from live state. Deployment version is the first service's image
tag. blacklist_device patches a label on the Device CR; run_command
stays a seam (needs agent-side transport).
serve_web now connects NATS + kube and builds RealFleetService when not
--mock (the bail is gone); --mock still uses the seeded MockFleetService
for offline UI work. Reads are on-demand per request — fine at staging
scale, a cache can follow.
Unit tests cover status derivation, primary-deployment selection,
version parsing, and alert derivation.
I feel like this is under-engineered a bit, the real.rs file being 400 lines long with tens of utility functions that feel like duplicate logic that is core to the operator for a significant number of them.
Overall this code makes sense but does not feel like high quality craftmanship. I think the changes could be even smaller and better integrated with the rest of the operator while remaining well architected.