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

Added support for updated Reserved IP behavior to existing resources (instance, network_ips) #6

Merged
merged 7 commits into from
Nov 8, 2024

Conversation

AniJ98
Copy link
Owner

@AniJ98 AniJ98 commented Oct 7, 2024

📝 Description

This PR implements functionality and tests for managing Reserved IP addresses in the Linodego client. These changes align with the updated Linode API, providing comprehensive support for Reserved IP operations. The changes include:

Implementation of core operations:

  • Deleting a Linode while retaining the Reserved IP
  • Retrieving IP information for Linodes, including Reserved IPs
  • Listing all IP addresses, including Reserved IPs
  • Allocating and assigning new Reserved IP addresses
  • Assigning Reserved IPs to Linodes
  • Fetching particular IP address, including Reserved IPs
  • Converting between Ephemeral and Reserved IPs

Test coverage:

  • TestInstance_DeleteInstanceVariants: Verifies Reserved IP retention after Linode deletion
  • TestReservedIPAddresses_GetIPReservationStatus: Tests retrieval of Linode IP information including Reserved IPs
  • TestIPAddresses_List_smoke: Checks filtering of all IPs by the reserved field.
  • TestIPAddress_Instance_Allocate: Covers various scenarios for allocating Reserved IPs
  • TestIPAddress_Instance_ReserveIP_Assign: Tests assigning Reserved IPs to Linodes
  • TestIPAddress_GetFound: Tests fetching information about a particular IP address, including Reseved IPs
  • TestIPAddress_Update: Verifies conversion between Ephemeral and Reserved IPs

✔️ 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_DeleteInstanceVariants

  2. 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 allocate/ assign a reserved IP to a linode.

@AniJ98 AniJ98 merged commit 968f780 into main Nov 8, 2024
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.

1 participant