Bug 985: Correct graph query in apstra_datacenter_device_allocation
resource when multiple candidate interface maps exist
#986
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.
Issue #985 describes a scenario where a given
system
node has multipleinterface_map
nodes linking it to thedevice_profile
node which matches the serial number of the user-specified switch.Consider the following terraform configuration:
along with the following graph elements:
In this case, the user has identified:
The correct graph traversal is obvious, but the code was not making use of the supplied interface map ID when querying the graph.
As a result, we'd find multiple matches and produce an error if multiple paths are found between the
system
and thedevice_profile
nodes.We should have been checking all of the user-specified details, both to avoid ambiguity, and to validate the user input.
This PR adds the
initial_interface_map_id
attribute to the graph query if the user has supplied it.