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 Next/PreviousSubnet() to netutil pkg #1424

Merged

Conversation

yunkon-kim
Copy link
Member

  • Add Next/PreviousSubnet()
  • Add these examples

This PR will add NextSubent() and PreviousSubent() and the following examples.

NextSubnet() test example - In case 4, Error: the next subnet is outside the base network range

NextSubnet() test example
[NextSubnet() Case1] Base Network CIDR: 10.0.0.0/16, Current Subnet CIDR: 10.0.0.0/18
 Next Subnet: 10.0.64.0/18
[NextSubnet() Case2] Base Network CIDR: 10.0.0.0/16, Current Subnet CIDR: 10.0.64.0/18
 Next Subnet: 10.0.128.0/18
[NextSubnet() Case3] Base Network CIDR: 10.0.0.0/16, Current Subnet CIDR: 10.0.128.0/18
 Next Subnet: 10.0.192.0/18
[NextSubnet() Case4] Base Network CIDR: 10.0.0.0/16, Current Subnet CIDR: 10.0.192.0/18
 Error: the next subnet is outside the base network range

PreviousSubnet() test example - In case 1, Error: the previous subnet is outside the base network range

PreviousSubnet() test example
[PreviousSubnet() Case1] Base Network CIDR: 10.0.0.0/16, Current Subnet CIDR: 10.0.0.0/18
 Error: the previous subnet is outside the base network range
[PreviousSubnet() Case2] Base Network CIDR: 10.0.0.0/16, Current Subnet CIDR: 10.0.64.0/18
 Previous Subnet: 10.0.0.0/18
[PreviousSubnet() Case3] Base Network CIDR: 10.0.0.0/16, Current Subnet CIDR: 10.0.128.0/18
 Previous Subnet: 10.0.64.0/18
[PreviousSubnet() Case4] Base Network CIDR: 10.0.0.0/16, Current Subnet CIDR: 10.0.192.0/18
 Previous Subnet: 10.0.128.0/18

* Add Next/PreviousSubnet()
* Add these examples
@seokho-son
Copy link
Member

/approve

Thanks! :)

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Jan 12, 2024
@cb-github-robot cb-github-robot merged commit ae71981 into cloud-barista:main Jan 12, 2024
3 checks passed
@yunkon-kim yunkon-kim deleted the yunkon-kim-patch-240112 branch January 12, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This PR is approved and will be merged soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants