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

networking: Allow configurable netnum offsets. #72

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

wlynch
Copy link
Member

@wlynch wlynch commented Jan 16, 2024

Previously this would try to assign a CIDR block starting from 1.
e.g. given cidr = "10.0.0.0/8" and regions = ["a", "b"], you would get:

a: "10.1.0.0/16"
b: "10.2.0.0/16"

Since this always starts at 1, this makes it difficult to be able to select a subnet range. This change adds a field to start subnet numbering at a specific number (starting at 0).

e.g. with the previous example and netnum_offset = 10, you would now get:

a: "10.10.0.0/16"
b: "10.11.0.0/16"

This is a breaking change if downstream consumers are sensitive to subnet netnum needing to start at 1, but can easily be fixed by adding the netnum_offset. I think we want to do this long term so we don't leave IPs with 0 unassigned.

Previously this would try to assign a CIDR block starting from 1.
e.g. given cidr = "10.0.0.0/8" and regions = ["a", "b"], you would get:

a: "10.1.0.0/16"
b: "10.2.0.0/16"

Since this always starts at 1, this makes it difficult to be able to
select a subnet range. This change adds a field to start subnet
numbering at a specific number (starting at 0).

e.g. with the previous example and netnum_offset = 10, you would now
get:

a: "10.10.0.0/16"
b: "10.11.0.0/16"
@wlynch wlynch requested a review from mattmoor January 16, 2024 23:04
@mattmoor mattmoor requested a review from joshrwolf January 16, 2024 23:21
@mattmoor
Copy link
Member

@wlynch you need to update docs for the new field

@wlynch wlynch merged commit 848b0fd into chainguard-dev:main Jan 23, 2024
22 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.

2 participants