Skip to content

fix: Make NodeBalancer.tags mutable - #371

Merged
lgarber-akamai merged 3 commits into
linode:devfrom
lgarber-akamai:fix/nb-tags-update
Feb 28, 2024
Merged

fix: Make NodeBalancer.tags mutable#371
lgarber-akamai merged 3 commits into
linode:devfrom
lgarber-akamai:fix/nb-tags-update

Conversation

@lgarber-akamai

@lgarber-akamai lgarber-akamai commented Feb 21, 2024

Copy link
Copy Markdown
Contributor

📝 Description

This change makes the NodeBalancer.tags attribute mutable to match the PUT /nodebalancers/{id} endpoint documentation.

Additionally, this change alters the create-version Makefile target to address minor differences between how the echo command handles escape characters on different systems.

✔️ How to Test

The following test steps assume you have pulled down this PR locally.

Unit Testing

make testunit

Manual Testing

  1. In a Python SDK sandbox environment (e.g. dx-devenv), run the following:
import os

from linode_api4 import LinodeClient

client = LinodeClient(token=os.getenv("LINODE_TOKEN"))

nb = client.nodebalancers.create(
    "us-mia",
    label="test-nb",
    tags=["cool"]
)

print("Original tags:", nb.tags)

nb.tags = ["foo", "bar"]
nb.label = "test-nb-updated"
nb.save()

nb.invalidate()

print("Updated & refreshed tags:", nb.tags)
  1. Ensure the output matches the following:
Original tags: ['cool']
Updated & refreshed tags: ['bar', 'foo']
  1. Navigate to the newly created NodeBalancer in Cloud Manager and ensure it has the tags bar and foo.

@lgarber-akamai
lgarber-akamai requested a review from a team as a code owner February 21, 2024 18:52
@lgarber-akamai
lgarber-akamai requested review from ykim-akamai and zliang-akamai and removed request for a team February 21, 2024 18:52

@zliang-akamai zliang-akamai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGMT, tests passed locally. Nice work!

@lgarber-akamai
lgarber-akamai merged commit fc27a62 into linode:dev Feb 28, 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.

3 participants