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

Document (or revisit) the reason that site is a mutable field #100

Open
henrybear327 opened this issue Oct 15, 2024 · 1 comment
Open

Document (or revisit) the reason that site is a mutable field #100

henrybear327 opened this issue Oct 15, 2024 · 1 comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Comments

@henrybear327
Copy link
Collaborator

What would you like to be added?

Discuss and document why we make site a mutable field but not tenant.

Why is this needed?

During the implementation of #90, we discovered that site being a mutable field will have an impact on allocation and restoration flow.

For example, if we have the following prefixes that will match the ParentPrefixSelector conditions:

10.0.1.0/24, tenant1, site1
10.0.2.0/24, tenant1, site2
10.0.3.0/24, tenant2, site1

Consider the following operation sequence (allocation):

  • we apply a CR with tenant value tenant1, site value site1, and the ParentPrefixSelector that will return the aforementioned set of prefixes -> 10.0.1.0/24 is picked as the parent prefix after the reconcile loop completes
  • we modify the site value to site2 -> what should we do?

Consider the following operation sequence (restoration):

  • we apply a CR with tenant value tenant1, site value site1, enable preserveInNetBox, and the ParentPrefixSelector that will return the aforementioned set of prefixes -> 10.0.1.0/24 is picked as the parent prefix after the reconcile loop completes, and the restoration hash is computed against the immutable fields only
  • we delete the CR
  • we modify the site value to site2
  • we apply the CR -> since site isn't used to calculate the hash, we can recover a prefix that doesn't satisfy the current CR requirement. Should we just abandon the restoration flow and allocate a new prefix from scratch? Or do we need to do something about the existing prefix first before we move on with further processing flow
@henrybear327 henrybear327 added documentation Improvements or additions to documentation bug Something isn't working enhancement New feature or request labels Oct 15, 2024
@henrybear327
Copy link
Collaborator Author

@jstudler what's your recollection of the decision to make site mutable :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant