Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 985: Correct graph query in apstra_datacenter_device_allocation resource when multiple candidate interface maps exist #986

Conversation

chrismarget-j
Copy link
Collaborator

Issue #985 describes a scenario where a given system node has multiple interface_map nodes linking it to the device_profile node which matches the serial number of the user-specified switch.

Consider the following terraform configuration:

resource "apstra_datacenter_device_allocation" "issue_985" {
  blueprint_id             = "irrelevant"
  node_name                = "A"
  initial_interface_map_id = "IF_MAP_A"
  device_key               = "123456"
}

along with the following graph elements:

                                /-->(interface_map IF_MAP_A)--\
(system A)-->(logical_device)==                                 ==>(device_profile B)
                                \-->(interface_map IF_MAP_B)--/

In this case, the user has identified:

  • the system (A)
  • the interface_map (IF_MAP_A)
  • the logical_device (by specifying device key 123456 which is a model "B" device)

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 the device_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.

@chrismarget-j chrismarget-j merged commit f8744fb into main Dec 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when multiple matching if-maps *but user has specified one*
2 participants