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

Eliminate bad assumption about logical interface node IDs #980

Merged
merged 4 commits into from
Dec 8, 2024

Conversation

chrismarget-j
Copy link
Collaborator

@chrismarget-j chrismarget-j commented Dec 4, 2024

The apstra_datacenter_ip_link_addressing resource takes the ID of a logical link node as input (link_id).

The actual IP addresses need to be assigned to the logical interface nodes on either end of the link, and the associated API call requires those interface node IDs as input.

The original version of the apstra_datacenter_ip_link_addressing resource assumed that the logical link IDs were immutable, but that's only partly true: Changes to the CT which created the logical link may cause the link and associated interfaces to be replaced. The link ID is constructed from predictable values, so it doesn't change even if replaced. The interface IDs will be different when they are removed and recreated.

Changes in this PR:

  • Computed attributes generic_interface_id and switch_interface_id have been removed.
  • Logical interface IDs are now determined at runtime in each of the four CRUD phases.
  • The original (pre-Create()) interface addressing strategy are now stored in private state (for restoration during Destroy()) using structs and methods in a new package private which can be extended to support similar use cases in the future.

Closes #978

@chrismarget-j chrismarget-j marked this pull request as draft December 4, 2024 23:29
@chrismarget-j chrismarget-j changed the title WIP: Eliminate bad assumption about logical interface node IDs Eliminate bad assumption about logical interface node IDs Dec 5, 2024
@chrismarget-j chrismarget-j marked this pull request as ready for review December 5, 2024 18:10
Copy link
Collaborator

@rajagopalans rajagopalans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after discussion.

@chrismarget-j chrismarget-j merged commit af39b98 into main Dec 8, 2024
1 check passed
@chrismarget-j chrismarget-j deleted the bug/978-logical-interface-ids-are-mutable branch December 8, 2024 00:25
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.

Bad assumption - Endpoint IDs are not so immutable
2 participants