Repository navigation
feat(inventory): add the physical inventory API to Milo - #155
Conversation
Add the fleet.datumapis.com/v1alpha1 inventory kinds: Facility, Rack, DeviceClaim, Device, Cable and PowerFeed, the Manufacturer and DeviceType hardware catalog, and the observational Site. config/milo registers their CRDs, ProtectedResources and the viewer, editor, manager and importer roles; the management-cluster roots install none of them. The records are operator-written and observational. No controller reads them, and creating one provisions nothing, publishes no capacity and establishes no readiness. CEL keeps Device identity and claim binding immutable, rejects ambiguous MACs and credential-bearing BMC endpoints, and validates faceplate layouts within the per-call cost limit. config/inventory renders the CRDs alone for an environment that installed them on the management cluster before Milo became their home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the operator guide for planning and registering devices, the hardware catalog contract, and the inventory proposal and reference appendix, and index them from the configuration, architecture, development and operations guides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ecv
left a comment
There was a problem hiding this comment.
Approve. Nothing deploys on merge: production pins fleet-kustomize by digest, and staging runs the feature-branch bundle. The four roles grant only explicit fleet.datumapis.com/<plural>.<verb> strings, and TestInventoryRolesSplitReadFromWrite fails if a verb is added. No customer role reaches the records: Milo's built-in roles carry no fleet grants or wildcards, and the only bindings are staff, the managers group and netbox-provider, all on project datum-cloud. The CRD matches the copy netbox-provider vendors.
Follow-ups:
- fleet#139 is present here: importer
patchcan change records another writer created. The next production pin bump puts that in production Milo, so close #139 first, or name non-forced SSA as the client contract. - fleet#153 hasn't landed, so main gets the legacy placement text,
ports[].expectedPeerand cableinterfaces[].peer. Removing them later breaks v1alpha1 for netbox-provider. Land #153 before the production pin moves. - The BMC rule only blocks userinfo.
?token=in the query or path passes. Reject query, fragment and path, or say it isn't a secret guard. - The inventory roles sit in Milo's assignable namespace, so a customer org holder can bind them on their own projects. That doesn't reach Datum's records, but say whether it's intended, or keep the roles out of that namespace.
Fleet keeps no legacy physical-inventory shapes. Every DeviceClaim is now a typed installation: - spec.lifecycle is required and only Installation. - spec.placement.scope is required; the text placement.facility and placement.rack fields are gone. - spec.ports, ExpectedPort and PortPeer are gone. Cable records are the only topology authority. - Device interfaces lose peer and keep name and macAddress. The CEL rules that only separated legacy from typed claims are deleted. Scope/reference agreement, the RackUnits position/height/face rule and immutable placement now apply to every claim. The DeviceClaim printer columns show scope and the facilityRef/rackRef names. Existing legacy-shaped objects fail validation on update and must be deleted or re-imported; there is no migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove the legacy slot example, the legacy text placement and inline peer descriptions, and the compatibility decision. Document the required lifecycle and scope and immutable placement. Point the proposal comparison at the implemented types instead of a pinned old revision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe record ownership generically instead of naming a deployment's GitOps object and path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kevwilliams
left a comment
There was a problem hiding this comment.
Hold: bmc.endpoint accepts secrets in the query, path or fragment, readable by every inventory viewer.
- The rule rejects only
@, sohttps://bmc/redfish?token=xandhttps://bmc/#pw=xare admitted; tightening after records exist breaks them on their next update. - Fix: also reject
?and#(viaurl(self).getQuery()/contains('#')). - Test: add query and fragment cases to
TestInvalidDevicesAreRejected.
The endpoint rule rejected only userinfo, so a token in the query, path, or fragment was admitted and readable by every inventory viewer. Tightening it after records exist would break them on their next update, so the endpoint is now an https host with an optional port and nothing else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host may be a DNS name or a bracketed IPv6 literal and the port must be digits, so a ';' suffix or an empty port is rejected. Tests now also pin the endpoints that must stay admitted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@kevwilliams the hold is fixed in 82569fe and 0f3d488:
@ecv this also covers the path case you raised. #153 is folded into this PR, so main never gets the legacy placement fields. |
kevwilliams
left a comment
There was a problem hiding this comment.
Verified the anchored host-and-port rule rejects query, fragment, path, parameter and userinfo endpoints, each covered by a TestInvalidDevicesAreRejected case; only the two BMC commits changed.
Adds the physical inventory API to Milo, so operators can record where a server is meant to go and which server is there. Recording either provisions nothing, publishes no capacity, and takes no ownership.
Related to #90. This is the first slice of that inventory feature branch to land on main. It also carries #153, so main never ships the old claim slots or inline cable peers. The staff UI, capacity registration, and the lab execution stack come in later PRs.
What changes
The standalone CRD-only root stays for an environment that installed the CRDs on the management cluster before Milo became their home.
Test plan
🤖 Generated with Claude Code