Skip to content

fix(network): 3.7 relax constraints for resizing dynamic range reservations - #561

Open
bryanfraschetti wants to merge 1 commit into
canonical:3.7from
bryanfraschetti:3.7_bpo_fix_dynamic_range_resizing
Open

bryanfraschetti wants to merge 1 commit into
canonical:3.7from
bryanfraschetti:3.7_bpo_fix_dynamic_range_resizing

Conversation

@bryanfraschetti

@bryanfraschetti bryanfraschetti commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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)

@bryanfraschetti bryanfraschetti changed the title fix(network): relax constraints for resizing dynamic range reservatio… fix(network): relax constraints for resizing dynamic range reservations Aug 21, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[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 bryanfraschetti changed the title fix(network): relax constraints for resizing dynamic range reservations fix(network): 3.7 relax constraints for resizing dynamic range reservations Aug 21, 2026
@bryanfraschetti
bryanfraschetti force-pushed the 3.7_bpo_fix_dynamic_range_resizing branch from 3053700 to fe04e5c Compare September 10, 2026 17:38
…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
AloizioMacedo force-pushed the 3.7_bpo_fix_dynamic_range_resizing branch from fe04e5c to dfadd3f Compare September 14, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants