Skip to content

Show lease time of reservations in the UI - #2317

Open
romanlum wants to merge 3 commits into
BeryJu:mainfrom
romanlum:feature/reservation-leasetime
Open

Show lease time of reservations in the UI#2317
romanlum wants to merge 3 commits into
BeryJu:mainfrom
romanlum:feature/reservation-leasetime

Conversation

@romanlum

Copy link
Copy Markdown
Contributor

Summary

  • Replace the Expiry == -1 sentinel for DHCP reservations with an explicit reservation boolean field on leases, so a reservation's actual last-issued lease time can still be tracked and shown instead of being overwritten by the sentinel.
  • Reservations no longer get an etcd TTL lease attached (so their record never expires), but Expiry is still updated on each Put for informational display; legacy records with expiry: -1 are migrated to reservation: true on read.
  • Update the MS DHCP import converter and the web UI (lease form + leases table) to use the new reservation field, and show "last leased until" for reservations that have an actual expiry.

Test plan

  • pkg/roles/dhcp: added unit tests for IsReservation(), legacy expiry: -1 migration in leaseFromKV, and that Put/CreateLeaseIfAbsent skip granting an etcd TTL lease for reservations while still tracking Expiry.
  • pkg/roles/dhcp: added API-level tests (APILeasesPut/APILeasesGet) verifying the reservation field round-trips through the API.
  • go test -p 1 ./pkg/roles/dhcp/... ./pkg/convert/... passes locally against etcd.
  • [x ] Manual check of the DHCP leases page in the browser (create/mark a reservation, verify "last leased until" renders).

🤖 Generated with the help of Claude Code

@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploy Preview for beryju-gravity canceled.

Name Link
🔨 Latest commit 3ced8b3
🔍 Latest deploy log https://app.netlify.com/projects/beryju-gravity/deploys/6a6c561c5317c60008f1ed0f

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.81%. Comparing base (c311230) to head (3ced8b3).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2317      +/-   ##
==========================================
+ Coverage   69.79%   69.81%   +0.02%     
==========================================
  Files         140      140              
  Lines        7733     7739       +6     
==========================================
+ Hits         5397     5403       +6     
  Misses       1794     1794              
  Partials      542      542              
Flag Coverage Δ
bench 12.72% <45.00%> (+0.01%) ⬆️
e2e 45.13% <50.00%> (+<0.01%) ⬆️
unittest 56.03% <100.00%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant