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

Add "auto" option to ipv4-subnet and ipv6-subnet #1962

Merged
merged 4 commits into from Apr 23, 2024

Conversation

mzagozen
Copy link
Contributor

If we do not care about the assigned IPv4/IPv6 subnet for the container network, we let the container runtime allocate one for us. This guarantees to avoid a collision of the hardcoded range (172.20.20.0/24 and 2001:172:20:20::/64) with any existing container networks. For example this makes it possible to run concurrent isolated topologies without directly modifying the topology files.

This just works for the podman runtime. For the docker runtime we compute the IPv6 subnet manually because it can only pick addresses from the configured (global) subnet.

@hellt
Copy link
Member

hellt commented Apr 19, 2024

thanks @mzagozen
I have rebased this PR since in the meantime we switched to go1.21.
I also added the docs/schema and slightly opimized the v6 ULA code.

Let me know if that seems OK to you and we can merge

mzagozen and others added 4 commits April 23, 2024 11:09
If we do not care about the assigned IPv4/IPv6 subnet for the container
network, we let the container runtime allocate one for us. This
guarantees to avoid a collision of the hardcoded range (172.20.20.0/24
and 2001:172:20:20::/64) with any existing container networks.

This just works for the podman runtime. For the docker runtime we
compute the IPv6 subnet manually because it can only pick addresses from
the configured (global) subnet.
@mzagozen
Copy link
Contributor Author

Agree on the docs and refactoring. I pushed another rebased branch to fix the diff in the GitHub UI.

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 34.78261% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 53.77%. Comparing base (90da85f) to head (608214a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1962      +/-   ##
==========================================
- Coverage   53.90%   53.77%   -0.13%     
==========================================
  Files         159      160       +1     
  Lines       11486    11504      +18     
==========================================
- Hits         6191     6186       -5     
- Misses       4433     4452      +19     
- Partials      862      866       +4     
Files Coverage Δ
runtime/podman/util.go 81.75% <100.00%> (ø)
runtime/docker/docker.go 72.07% <60.00%> (-0.35%) ⬇️
utils/ip.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

@hellt hellt merged commit 313b18a into srl-labs:main Apr 23, 2024
62 of 63 checks passed
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.

None yet

2 participants