Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

More helpful error message when --ip-alloc-range mismatched #1174

Merged
merged 4 commits into from
Jul 17, 2015

Conversation

bboreham
Copy link
Contributor

Fixes #1128

I did an additional check at the Allocator level rather than modifying the check inside Ring, to keep the latter unaware of why Merge has been called.

prefixLen := 32
for size := r.Size(); size > 1; size = size / 2 {
if size%2 != 0 { // Size not a power of two; cannot be expressed as a CIDR.
return fmt.Sprintf("[Range cannot be expressed in CIDR format] %s", r)

This comment was marked as abuse.

This comment was marked as abuse.

@bboreham bboreham force-pushed the 1128-iprange-error branch from 16ab956 to 1f4b943 Compare July 17, 2015 10:42
@rade
Copy link
Member

rade commented Jul 17, 2015

I did an additional check at the Allocator level rather than modifying the check inside Ring, to keep the latter unaware of why Merge has been called.

Fair enough, but that means you really ought to change the error message and error name in the Ring code.

@bboreham bboreham force-pushed the 1128-iprange-error branch from a00671d to 2dbf838 Compare July 17, 2015 11:20
rade added a commit that referenced this pull request Jul 17, 2015
More helpful error message when --ip-alloc-range mismatched

Closes #1128.
@rade rade merged commit 358ae3a into master Jul 17, 2015
@rade rade deleted the 1128-iprange-error branch July 17, 2015 12:51
@rade rade added this to the 1.1.0 milestone Jul 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants