feat: add support for specifying starting IP address for BMC and node allocation #2
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.
Checklist
make test(or equivalent) locally and all tests passgit commit -s) with my real name and email<filename>.licensesidecarLICENSES/directoryDescription
This pull request adds support for specifying the starting IP address for both BMC and node IP allocation, allowing users to reserve lower IPs in a subnet (e.g., for gateways or DNS) and begin allocation at a desired address. The implementation introduces new command-line flags, updates the allocation logic, and adds comprehensive tests and documentation.
Key changes include:
Feature: Start IP allocation at a specific address
--start-ipflag toinit-bmcsand--node-start-ipflag todiscover, enabling users to skip a range of IPs at the beginning of the subnet for both BMC and node allocations. [1] [2] [3] [4]internal/netalloc/ipam.gowith a newReserveUpTomethod, which reserves all IPs before the specified start IP. This is used by bothinitbmcs.Generateanddiscover.UpdateNodes. [1] [2] [3] [4]Documentation updates
README.mdwith usage examples and explanations for the new--start-ipand--node-start-ipflags, clarifying how to reserve IPs at the start of a subnet. [1] [2]Testing
ReserveUpTomethod and for generating BMC entries with a specified start IP, ensuring correct behavior and error handling. [1] [2]Internal API changes
initbmcs.Generateanddiscover.UpdateNodesto accept the new start IP parameters, maintaining backward compatibility. [1] [2] [3]These changes provide more flexible IP management and improve usability for network administrators.
Type of Change
For more info, see Contributing Guidelines.