This repository has been archived by the owner on Oct 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Raise error if IPPool is created with a bad cidr block size #82
Merged
robbrockbank
merged 2 commits into
projectcalico:master
from
TrimBiggs:ipam-block-size-error
Feb 6, 2016
Merged
Raise error if IPPool is created with a bad cidr block size #82
robbrockbank
merged 2 commits into
projectcalico:master
from
TrimBiggs:ipam-block-size-error
Feb 6, 2016
Conversation
This file contains 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
TrimBiggs
force-pushed
the
ipam-block-size-error
branch
2 times, most recently
from
February 5, 2016 23:20
ad04fd9
to
fc346e4
Compare
@@ -133,9 +134,16 @@ def __init__(self, cidr, ipip=False, masquerade=False, ipam=True): | |||
""" | |||
# Normalize the CIDR (e.g. 1.2.3.4/16 -> 1.2.0.0/16) | |||
self.cidr = IPNetwork(cidr).cidr | |||
self.ipam = bool(ipam) | |||
if self.ipam: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a comment to the doc string to indicate the limitation on the CIDR when used with calico IPAM module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
Minor comment and then LGTM. |
TrimBiggs
force-pushed
the
ipam-block-size-error
branch
from
February 6, 2016 00:27
fc346e4
to
bf2c7c6
Compare
@@ -543,3 +543,9 @@ class AddressNotAssignedError(BlockError): | |||
Tried to query an address that isn't assigned. | |||
""" | |||
pass | |||
|
|||
class AddressRangeNotAllowedError(BlockError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I like the name of this. It isn't a range. it's a CIDR.
Perhaps just CIDRToSmallError or something along those lines.
TrimBiggs
force-pushed
the
ipam-block-size-error
branch
from
February 6, 2016 01:12
0a296cc
to
cb043fd
Compare
LGTM |
robbrockbank
pushed a commit
that referenced
this pull request
Feb 6, 2016
Raise error if IPPool is created with a bad cidr block size
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes https://github.com/projectcalico/calico-containers/issues/505