feat: PUC-1758: remove physical_network fallback lookup - #2145
feat: PUC-1758: remove physical_network fallback lookup#2145haseebsyed12 wants to merge 1 commit into
Conversation
3d18f99 to
1d25276
Compare
1d25276 to
5babf60
Compare
|
Rebase: rebased onto current Re: 1. Move the enforcement to PRECOMMITTwo of the three new
Neutron publishes Please convert this protection to a PRECOMMIT trigger:
Also note 2. Add testsNone of the three new raise paths are currently exercised — 184 tests pass without touching them. Also, Notes
|
5babf60 to
618ae76
Compare
|
Pushed a rebase onto current
|
618ae76 to
034a505
Compare
Ironic requires a physical_network on the baremetal port to attach a vif and
passes it through in the binding_profile, so the fallback that queried Ironic
for the port matching local_link_information was only ever a workaround. Drop
it, along with the synchronous Ironic API call it made on the bind path.
With the fallback gone, a missing physical_network is a hard error. Enforce
it on the precommit hooks only:
* subports/trunk PRECOMMIT_CREATE raise BadRequest, aborting the
transaction and surfacing the error to the API caller.
* New subports/trunk PRECOMMIT_DELETE handlers validate the parent port
before the teardown commits, since the AFTER_DELETE hook that does the
switchport cleanup cannot roll anything back. Only a still-bound parent
port blocks the delete; an unbound one tears down as before.
* The AFTER_CREATE and AFTER_DELETE hooks log instead of raising. They run
after the rows are committed, where an exception cannot undo the change
and, because the subscriptions are cancellable, would surface as a 500.
The delete path still releases its segments so their VLANs do not leak,
and only skips the undersync call.
bind_port_segment keeps refusing the bind and logging, now including the
port and network ids.
Also drops the helpers the fallback was the only caller of:
IronicClient.baremetal_port_physical_network, its _port_by_local_link
helper, and utils.local_link_from_binding_profile.
Co-Authored-By: Doug Goldstein <doug.goldstein@rackspace.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
034a505 to
3468dea
Compare
|
LGTM. |
mfencik
left a comment
There was a problem hiding this comment.
We may consider removing the vlan_group check when deleting ports at some point as we should only bind the ports that have vlan_group present. But for the moment let's leave it there obviously.
What does this change do?
Ironic requires a
physical_networkon the baremetal port to attach a vif and passes it through in thebinding_profile, so the fallback that queried Ironic for the port matchinglocal_link_informationwas only ever a workaround. This removes it, which also drops a synchronous Ironic API call from the port bind path.With the fallback gone a missing
physical_networkis a hard error, enforced on the precommit hooks:SUBPORTS/TRUNKPRECOMMIT_CREATEraiseBadRequest, aborting the transaction and surfacing the error to the API caller.SUBPORTS/TRUNKPRECOMMIT_DELETEhandlers validate the parent port before the teardown commits, since theAFTER_DELETEhook that does the switchport cleanup cannot roll anything back. Only a still-bound parent port blocks the delete; an unbound one tears down as before.AFTER_CREATE/AFTER_DELETEhooks log instead of raising. They run after the rows are committed, where an exception cannot undo the change and — the subscriptions beingcancellable— would surface as a 500. The delete path still releases its segments so their VLANs do not leak, and only skips theundersynccall.bind_port_segmentstill refuses the bind and logs, now including the port and network ids.Also drops the helpers the fallback was the only caller of:
IronicClient.baremetal_port_physical_network, its_port_by_local_linkhelper, andutils.local_link_from_binding_profile.Upgrade impact
upgrade-impactlabel and a release note: runscriv createfrom therepository root and describe the required action in the generated
changelog.d/file. See RELEASING.md.Operator action means anything a deployment has to do beyond a normal resync:
deploy repo or values changes, new or removed secrets, enabling or disabling a
component, or a manual one-time step.