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

Improve planning logic for link modifications in apstra_datacenter_generic_system resource #1038

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

chrismarget-j
Copy link
Collaborator

@chrismarget-j chrismarget-j commented Feb 14, 2025

This PR introduces resourceDatacenterGenericSystem.ModifyPlan(). It exists to trigger replacement of the generic system if the user has replaced or changed the speed of every link. A single surviving link will allow the system to be updated in place.

Changes in this PR:

  • rename DatacenterGenericSystem.links() -> DatacenterGenericSystem.GetLinks() (make public)
  • rename DatacenterGenericSystemLink.digest()-> DatacenterGenericSystemLink.Digest() (make public)
  • change of transform ID no longer automatically triggers system replacement
  • DatacenterGenericSystem.UpdateLinkSet() now collects links with transform ID changes and replaces them one-at-a-time
  • DatacenterGenericSystem.UpdateLinkSet() now invokes deleteLinksFromSystem() before addLinksToSystem() (order swapped) to accommodate changes which may involve the same physical resource. For example, you can't add a link to xe-0/0/0 before deleting the link to ge-0/0/0 because the use the same physical connector
  • The genericSystemLinkSetValidator now checks for unknown values - minor change but looks like a big diff because large chunks of code "bumped" to the right because they're within the unknown check.
  • Detection of the "all links replaced" condition is handled by a plan new resource modifier: resourceDatacenterGenericSystem.ModifyPlan()

@chrismarget-j chrismarget-j linked an issue Feb 14, 2025 that may be closed by this pull request
@chrismarget-j chrismarget-j marked this pull request as draft February 14, 2025 22:38
@chrismarget-j chrismarget-j changed the title WIP: Make r/generic_system less likely to destroy/create on link change Make r/generic_system less likely to destroy/create on link change Feb 14, 2025
@chrismarget-j chrismarget-j changed the title Make r/generic_system less likely to destroy/create on link change Improve planning logic for link modifications in apstra_datacenter_generic_system resource Feb 21, 2025
@chrismarget-j chrismarget-j marked this pull request as ready for review February 21, 2025 17:54
@chrismarget-j
Copy link
Collaborator Author

Closes #1041

@chrismarget-j chrismarget-j requested review from rajagopalans and removed request for rajagopalans February 28, 2025 02:46
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.

Require generic system replacement when all links are replaced
1 participant