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

Replace netaddr with ipaddr #2543

Merged
merged 5 commits into from
Aug 9, 2024
Merged

Replace netaddr with ipaddr #2543

merged 5 commits into from
Aug 9, 2024

Conversation

aramprice
Copy link
Member

@aramprice aramprice commented Aug 5, 2024

What is this change about?

Replace vendored NetAddr gem dev version and replace it with the ruby standard IPAddr gem

What tests have you run against this PR?

How should this change be described in bosh release notes?

n/a

Does this PR introduce a breaking change?

No.

@aramprice aramprice force-pushed the replace-netaddr branch 4 times, most recently from 105e4e8 to 07fbd70 Compare August 5, 2024 23:27
... rather than relying on an include in
`src/bosh-director/lib/bosh/director.rb`
The internal class IpAddrOrCidr uses the ruby stdlib IPAddr class
internally.

Note that IPAddr is used in specs and cloud/dummy{,_v2}.rb code since
these bits of code my not have access to `Bosh::Director` code at
runtime.

Signed-off-by: Ming Xiao <ming.xiao@broadcom.com>
@aramprice aramprice marked this pull request as ready for review August 7, 2024 20:57
@aramprice aramprice requested review from a team, ystros and mvach and removed request for a team August 7, 2024 20:57
@@ -50,7 +50,7 @@ def allocate_dynamic_ip(reservation, subnet)
retry
end

@logger.debug("Allocated dynamic IP '#{ip_address.ip}' for #{reservation.network.name}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Mostly commenting since it wasn't immediately intuitive to me: IpAddr#to_s returns only the IP address portion provided, even for CIDRs, and thus is equivalent to the old NetAddr#ip.

@ystros ystros merged commit 97aca71 into main Aug 9, 2024
4 checks passed
@ystros ystros deleted the replace-netaddr branch August 9, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants