Repository navigation
Conversation
02cfd99 to
a67a47f
Compare
16556dd to
d694700
Compare
a67a47f to
7133e23
Compare
d694700 to
7ab592b
Compare
7133e23 to
8c40a8a
Compare
0d5fc23 to
e939ed4
Compare
54b52eb to
c1d66c7
Compare
e939ed4 to
5bd598d
Compare
c1d66c7 to
f360646
Compare
5bd598d to
a9fc017
Compare
6bc39b4 to
ff91454
Compare
a9fc017 to
be930e8
Compare
ff91454 to
f417f2d
Compare
be930e8 to
667870c
Compare
f417f2d to
ce8b479
Compare
55ab503 to
d9dcabb
Compare
ecv
left a comment
There was a problem hiding this comment.
Request changes.
Nothing is wired (no Mode, no Authorizer, nil Network refuses every interface before anything is reserved), and the attach and release paths look right, but the tenancy and authorization guards in nso.Adapter.Check have no test that fails when they are removed. That is the guard that stops one tenant attaching a server to another tenant's Network the moment NSO gets a physical mode and someone sets Mode, so it should be pinned first.
- Removing
reference.Namespace != machine.Namespace(the cross-tenant Network refusal) leavesgo test ./internal/network/... ./internal/allocation/ ./internal/staging/green. Add a Check case that names a Network in another namespace and expectsErrUnauthorized. - Removing
a.Authorizer == nil || principal == ""(the fail-closed default) also leaves everything green; the allocation tests setModeand an authorizer together. Add cases for nil authorizer, empty principal, and an authorizer that denies. - Guards that did fail when removed: the
Mode == ""refusal, the call toAuthorizeNetworkUse(TestMachineInterfacesAttachThroughNSO), the claim-UID adoption check (TestEnsureAdoptsOnlyFleetsOwnClaim), and the network gate inRelease(allocation tests).
On the deletion (-1440): internal/network/contracts.go (the Plan/Lifecycle/UseAuthorizer contract) and the old adapter and its 689-line test are replaced by network.go and a smaller adapter. Nothing else imports the removed identifiers (go-test passes on all planes), and Check and Ensure now take over what the old UseAuthorizer did. Attachment happens only for an Active allocation, and Machine interface inputs are immutable on the CRD (allocation inputs are immutable), so a later edit cannot skip Check. Release closes the Network and Address gates only after every recorded claim is gone, before wipe, and stalls with ErrUnsupported if the owner is unset but claims are recorded.
Follow-ups:
- Fleet needs RBAC to create and delete interface claims and read them in consumer projects; the body says it is undefined. Add a least-privilege Role in its own non-included component, as #194 did for IPAM, before any environment enables attachment.
- The manager now watches
NetworkInterfaceClaimin every project control plane; confirm the CRD is served everywhere first, as the body asks, or the watch may fail startup in a project without it. AuthorizeNetworkUseruns only inCheck, before allocation. If the authorizer's answer can change while the Machine lives, re-check atEnsure.- A cabling-inventory miss is found only after capacity is reserved and is never retried (already listed in the body); resolve
LocateinCheckNetworkso it fails before reserving.
ecv
left a comment
There was a problem hiding this comment.
Approve.
The new commit pins both guards from my hold: an interface on a Network in another namespace is refused even when the authorizer would allow it, and a missing authorizer, an empty principal and a denying authorizer each refuse with ErrUnauthorized. Test-only; the rest is unchanged since d9dcabb.
|
Thanks. At 0699b57, a new test pins both guards in the network check: an interface on another tenant's Network is refused even when the principal may use it, and so is every interface with no authorizer, no principal or an authorizer that denies. Removing either guard now fails the test. The follow-ups are in the body as decisions before any environment enables attachment: a least-privilege role for interface claims in its own component, re-checking network use when the claim is made, confirming the claims CRD is served in every project control plane, and resolving the cabling before capacity is reserved. |
Replace the unwired NSO adapter. The Metal provider checks each Machine interface before allocation, records its attachment point from Device inventory and cable records on the allocation, creates one NSO claim per interface, and reports addresses and readiness on the Machine. Claim events wake the Machine. Release closes the Network and Address gates only once every claim is gone. NSO has no physical attachment mode, so every mode still refuses interfaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Write NetworkReady=Unknown when NSO cannot be read instead of keeping a stale True, record each proven claim UID before returning a later interface's error, test that a claim event wakes only its Machine, and document adoption risk, Retain, and a release stalled on a missing NSO API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removing the check that keeps a Machine's interfaces on Networks in its own namespace, or the check that refuses every interface when no network-use check can run, left every test passing. A test now refuses another tenant's Network, a missing authorizer, an empty principal and an authorizer that denies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
283073c to
5617a92
Compare
0699b57 to
cb55594
Compare
ecv
left a comment
There was a problem hiding this comment.
Approve.
Rebase onto the merged power stack. The only change to this PR's commit is the staging handler merge: it keeps poweredOff (unset or Off) from the base and still drops the networkless requirement only when the allocator has a network owner. Intent unchanged.
A Machine's requested network interfaces are now checked before any capacity is reserved, attached through NSO with one interface claim each on the switch port Device inventory names, and reported on the Machine with their addresses and a NetworkReady condition. Release waits until NSO drops every claim. NSO has no physical attachment mode and no network-use authorizer exists, so every mode still refuses interfaces. Stacked on #197, beside #216.
Related to #186
How it stays inactive
Nothing wires a network owner: no binary or configuration sets one, and with none every interface request is refused before anything is reserved. Machines that request no interfaces behave as before. On staging, a Machine that requests interfaces now stays Pending with nothing reserved, instead of being rejected outright. The allocation gains an optional status field, so no existing object becomes invalid.
Decisions for a person
Test plan
gh pr checksentry green on the head, including the multi-plane acceptance🤖 Generated with Claude Code