-
Notifications
You must be signed in to change notification settings - Fork 661
[RFC0038] Introduce prefix allocation #2611
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
Merged
aramprice
merged 21 commits into
cloudfoundry:main
from
fmoehler:introduce-prefix-allocation
Sep 25, 2025
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
3382ccc
Squashed commit of the following:
fmoehler 3df9df2
fix bug for base address searching
fmoehler 77aefa9
fix unit test
fmoehler ba39e7e
fix unit test
fmoehler 9bbae2c
do not expand ips in reserved range
fmoehler 778bded
refactor pt1
fmoehler fd06c97
automatically select correct base address of static ip range
fmoehler 0ef6725
refactor to_cidr_s
fmoehler 8331c4d
refactor to_cidr_s pt2 and use constants
fmoehler 0951cb7
refactor iputil
fmoehler b80ec1b
use to_ipaddr
fmoehler e705391
add nic_group option to job network
fmoehler 5b8de4b
fix bug
fmoehler d0aa94f
fix nic_group bug
fmoehler ff37709
refactor base_addr and its usage
fmoehler 826e4bc
consider changes in nic group
fmoehler 64b36f4
refactoring
Ivaylogi98 56601c5
Apply suggestions from code review
fmoehler 76a3dee
remove unnecessary iputil include
fmoehler 87fa8d1
Small refactoring and code readability
neddp 44535d1
Remove unnecessary whitespace in dynamic_ips method
neddp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...rations/20250618102610_migrate_ip_address_representation_from_integer_to_cidr_notation.rb
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| Sequel.migration do | ||
| up do | ||
| alter_table(:ip_addresses) do | ||
| add_column :nic_group, Integer, null: true | ||
| end | ||
|
|
||
| from(:ip_addresses).each do |row| | ||
| integer_representation = row[:address_str].to_i | ||
|
|
||
| cidr_notation = Bosh::Director::IpAddrOrCidr.new(integer_representation).to_s | ||
|
|
||
| from(:ip_addresses).where(id: row[:id]).update(address_str: cidr_notation) | ||
| end | ||
| end | ||
| down do | ||
| alter_table(:ip_addresses) do | ||
| drop_column :nic_group | ||
| end | ||
| from(:ip_addresses).each do |row| | ||
| cidr_notation = row[:address_str] | ||
|
|
||
| ip_addr = Bosh::Director::IpAddrOrCidr.new(cidr_notation) | ||
| integer_representation = ip_addr.to_i | ||
| from(:ip_addresses).where(id: row[:id]).update(address_str: integer_representation) | ||
| end | ||
| end | ||
| end |
This file contains hidden or 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
This file contains hidden or 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
5 changes: 3 additions & 2 deletions
5
src/bosh-director/lib/bosh/director/deployment_plan/dynamic_network_subnet.rb
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| module Bosh::Director | ||
| module DeploymentPlan | ||
| class DynamicNetworkSubnet | ||
| def initialize(dns, cloud_properties, availability_zone_names) | ||
| def initialize(dns, cloud_properties, availability_zone_names, prefix) | ||
| @dns = dns | ||
| @cloud_properties = cloud_properties | ||
| @availability_zone_names = availability_zone_names.nil? ? nil : availability_zone_names | ||
| @prefix = prefix.to_s | ||
| end | ||
|
|
||
| attr_reader :dns, :cloud_properties, :availability_zone_names | ||
| attr_reader :dns, :cloud_properties, :availability_zone_names, :prefix | ||
| end | ||
| end | ||
| end |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.