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

Support for Adding Additional Reserved IP to Existing Linodes #581

Merged
merged 38 commits into from
Sep 25, 2024

Conversation

AniJ98
Copy link
Contributor

@AniJ98 AniJ98 commented Sep 17, 2024

📝 Description

This PR introduces functionality and tests for creating Linodes with reserved IP addresses and adding additional reserved IPs to existing Linodes in the Linodego client. These changes are necessary to provide comprehensive support for managing Linodes with reserved IP addresses through the Linode API. The changes include:

  1. Implementation of core operations:
  • Creating a Linode with a reserved IP
  • Adding an additional reserved IP to an existing Linode
  1. Test coverage:
  • TestInstance_CreateWithReservedIPAddress: Tests creating a Linode with a reserved IP.
  • TestInstance_CreateWithReservedIPAddress (Variants): Tests various scenarios for creating a Linode with a reserved IP.
  • TestInstance_AddReservedIPToInstance: Tests adding a reserved IP to an existing Linode.
  • TestInstance_AddReservedIPToInstanceVariants: Covers different cases for adding a reserved IP to an existing Linode.

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?

  1. Ensure you have a valid Linode API token.
Set up your environment:


export LINODE_TOKEN="your_token_here"


Additionally you need to set the following if you want to test it in a different environment:

export LINODE_URL="https://api.linode.com"
export LINODE_API_VERSION="v4beta"
  1. Navigate to the test directory within the linodego project.
Update the LINODE_TOKEN in the Makefile:


LINODE_TOKEN="your_token_here"


Run the tests using one of the following commands:
To run all integration tests:

make testint

To run a specific test:


go test -v ./integration -run TestInstance_CreateWithReservedIPAddress

Verify the test output for any failures or unexpected behavior.

Note:
Ensure that you have enough quota to reserve IP before adding it to an existing linode. Ensure the IPMAX limit is enough to add additional reserved IP addresses to the linode.

AniJ98 and others added 30 commits September 16, 2024 16:04
…d, InsuffecientPermission, ReserveIP, GetReservedIP, getReservedIPs, DeleteReservedIPs
… feature. Removed for loop to reserve IPs till limit is reached.
* build(deps): bump golang.org/x/oauth2 from 0.22.0 to 0.23.0

Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.22.0 to 0.23.0.
- [Commits](golang/oauth2@v0.22.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Ran make tidy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ezilber-akamai <[email protected]>
* build(deps): bump golang.org/x/text from 0.17.0 to 0.18.0

Bumps [golang.org/x/text](https://github.com/golang/text) from 0.17.0 to 0.18.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](golang/text@v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* make tidy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ye Chen <[email protected]>
…ing endpoints (linode#573)

* Add LKE types endpoints

* Support base struct; add NB types endpoints

* Add volume types

* Add network transfer prices

* Add price and region price structs

* Revert IPv6 fixtures

* Add missing fixtures
…ual test funcitons and removed debugging log statements
…st functions, made changes to error messages
@AniJ98 AniJ98 requested a review from a team as a code owner September 17, 2024 21:47
@AniJ98 AniJ98 requested review from lgarber-akamai and zliang-akamai and removed request for a team September 17, 2024 21:47
instance_ips.go Outdated Show resolved Hide resolved
instances.go Outdated Show resolved Hide resolved
@lgarber-akamai lgarber-akamai self-requested a review September 24, 2024 14:41
Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

All tests are passing on my end. Thanks for the quality contribution and the comprehensive test suite!

Copy link
Member

@zliang-akamai zliang-akamai left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@zliang-akamai zliang-akamai merged commit b20be2e into linode:main Sep 25, 2024
4 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.

5 participants