Skip to content
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

use free subnet to create network #1245

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

junnplus
Copy link
Member

@junnplus junnplus commented Jul 19, 2022

Signed-off-by: Ye Sijun [email protected]

We use increment id as the subnet part in the past, it is easy to cause subnet conflicts.

Introduce GetFreeSubnet to find a free subnet, and check conflict when specify a subnet

@junnplus junnplus force-pushed the bridge-interface branch 11 times, most recently from b60900a to 5a66193 Compare July 19, 2022 09:54
@junnplus junnplus marked this pull request as ready for review July 19, 2022 10:30
@junnplus junnplus requested a review from AkihiroSuda July 19, 2022 10:31
@junnplus junnplus changed the title bridge network use free subnet use free subnet to create network Jul 19, 2022
@AkihiroSuda AkihiroSuda added this to the v0.22.1 milestone Jul 19, 2022
@junnplus junnplus force-pushed the bridge-interface branch 4 times, most recently from 3459a08 to 021eeef Compare July 19, 2022 13:19
pkg/netutil/netutil.go Show resolved Hide resolved
pkg/netutil/netutil.go Outdated Show resolved Hide resolved
pkg/netutil/subnet/subnet.go Show resolved Hide resolved
@junnplus junnplus force-pushed the bridge-interface branch 2 times, most recently from ece73e3 to 8a898e0 Compare July 20, 2022 05:20
cmd/nerdctl/network_ls.go Outdated Show resolved Hide resolved
return err
}
// writeNetworkConfig writes networkConfig file to cni config path.
func (e *CNIEnv) writeNetworkConfig(net *networkConfig) error {
Copy link
Member

Choose a reason for hiding this comment

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

Both the Ctrl-C or No space can cancel the write and maybe there is invalid data in file. Suggest to use atomic write and make sure that content is correct.

Copy link
Member Author

Choose a reason for hiding this comment

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

If needed, maybe another PR

pkg/netutil/netutil.go Show resolved Hide resolved
@AkihiroSuda AkihiroSuda requested a review from fuweid July 21, 2022 08:35
@AkihiroSuda
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants