Keep TunnelEndpoint network_id as a multi-VNI map - #102
Open
ed6869 wants to merge 1 commit into
Open
Conversation
A Tunnel Endpoint (indexed by vrf, origin, destination) can flood several VNIs
at once. The previous get() collapsed network_id to a single VNI object and
create()/update() only serialized one VNI, which dropped the other VNIs of a
shared TEP. Keep network_id as the full {vni_key: uri} map on get(), and
serialize a single VNI, a list of VNIs, or an existing map on create()/update()
via a new _network_id_payload() helper. Adds offline unit tests.
Signed-off-by: ed6869 <ed6869@mail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #104
Companion collection PR: aruba/aoscx-ansible-collection#212
Summary
A Tunnel Endpoint (TEP) is indexed by
(vrf, origin, destination)and can flood several VNIs at once through itsnetwork_idmap. The previous implementation collapsednetwork_idto a single VNI object onget()and only serialized one VNI oncreate()/update(), which silently dropped the other VNIs of a shared TEP.Changes
get()now keepsnetwork_idas the full{vni_key: uri}map instead of collapsing it to a single VNI._network_id_payload()helper serializes a single VNI, a list of VNIs, or an existing{vni_key: uri}map into the form the REST API expects.create()andupdate()use the helper.tests/test_tunnel_endpoint.py).Testing
pytest tests/test_tunnel_endpoint.py).latest): a static VTEP peer shared by two VNIs is preserved when removed from one of them.