-
Notifications
You must be signed in to change notification settings - Fork 606
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
Fix subnet overlapping #2358
Fix subnet overlapping #2358
Conversation
@@ -475,7 +475,7 @@ func (e *CNIEnv) parseSubnet(subnetStr string) (*net.IPNet, error) { | |||
return nil, err | |||
} | |||
if subnetStr == "" { | |||
_, defaultSubnet, _ := net.ParseCIDR(DefaultCIDR) | |||
_, defaultSubnet, _ := net.ParseCIDR(StartingCIDR) |
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.
Need to define StartingCIDR
in https://github.com/containerd/nerdctl/blob/main/pkg/netutil/netutil_windows.go
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.
Fixed. Thank you.
@@ -40,6 +40,8 @@ const ( | |||
DefaultNetworkName = "bridge" | |||
DefaultCIDR = "10.4.0.0/24" | |||
DefaultIPAMDriver = "host-local" | |||
|
|||
StartingCIDR = "10.4.1.0/24" |
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.
Needs a comment line to explain how this is different from DefaultCIDR
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 a comment for StartingCIDR
, thanks.
Please squash commits |
https://github.com/containerd/nerdctl/actions/runs/5578004366/jobs/10191593601?pr=2358 |
Signed-off-by: York Yao <york.yaoluxunzhe@hotmail.com>
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.
Thanks
#2322
Fix subnet address space overlapping under such circumstance:
when there's no default
bridge
network,nerdctl network create {...}
without passing--subnet
(this will create a non-default network but use up the default CIDR10.4.0.0/24
);nerdctl run {...}
using the default network