fix(network): 3.7 relax constraints for resizing dynamic range reservations - #561
Open
bryanfraschetti wants to merge 1 commit into
Open
bryanfraschetti wants to merge 1 commit into
bryanfraschetti wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
[maas-code-reviewer review]
LLM-generated review from https://github.com/canonical/maas-code-reviewer.
Intended to assist a human reviewer, not replace one — suggestions may be
incorrect, please verify before acting.
This is a well-thought-out and elegant fix. The logic for isolating newly added segments and validating only those against the available unused ranges perfectly addresses the discontinuous range issue caused by in-range IP allocations. The bounds logic is sound, handles edge cases (like expanding to/from IP 0) cleanly, and the test coverage is thorough and accurately reflects the reported bug. No issues found.
bryanfraschetti
force-pushed
the
3.7_bpo_fix_dynamic_range_resizing
branch
from
September 10, 2026 17:38
3053700 to
fe04e5c
Compare
…ns (canonical#280) When an IP is allocated inside a dynamic range reservation, the validation performed during a resize sees the range as discontinuous, since an allocated IP splits the available space into separate contiguous blocks. As a result, both shrinking and expanding the reservation are rejected with "Requested dynamic range conflicts with an existing IP address or range", even when the requested change is otherwise valid. This commit addresses the issue by comparing the requested range against the previously persisted range and requiring only the newly added segments (i.e., the expanded portions) to be contained within an unused range. Pure shrinks add no segments and are always allowed. Resolves LP:2143090
AloizioMacedo
force-pushed
the
3.7_bpo_fix_dynamic_range_resizing
branch
from
September 14, 2026 13:02
fe04e5c to
dfadd3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When an IP is allocated inside a dynamic range reservation, the validation performed during a resize sees the range as discontinuous, since an allocated IP splits the available space into separate contiguous blocks. As a result, both shrinking and expanding the reservation are rejected with "Requested dynamic range conflicts with an existing IP address or range", even when the requested change is otherwise valid.
This commit addresses the issue by comparing the requested range against the previously persisted range and requiring only the newly added segments (i.e., the expanded portions) to be contained within an unused range. Pure shrinks add no segments and are always allowed.
Resolves LP:2143090
(cherry picked from commit 8e8c3f6)