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

Deprecate Group Field of Instance Options; Retype Group in InstanceUpdateOptions to be String Pointer #457

Merged
merged 6 commits into from
Feb 20, 2024

Conversation

zliang-akamai
Copy link
Member

@zliang-akamai zliang-akamai commented Feb 14, 2024

📝 Description

Users may want to delete the value of group, a deprecated attribute of a Linode instance. We can make it to be a pointer to allow users pass in an empty string to remove the attribute on the cloud.
Original issue is reported in our TF provider repository: linode/terraform-provider-linode#1296

✔️ How to Test

Automated Testing

make ARGS="-run TestInstance" fixtures

Manual Testing

linodeClient := linodego.NewClient(oauth2Client)
linodeClient.SetDebug(true)
instance, _ := linodeClient.CreateInstance(context.Background(), linodego.InstanceCreateOptions{
	Label: "test-group-remove2",
	Type: "g6-nanode-1",
	Image: "linode/debian12",
	Group: "test-group",
	Region: "us-mia",
	RootPass: "wevgfhyuwe23uifcgbvwuiovfcbujwosbv",
})
group := ""
instance, _ = linodeClient.UpdateInstance(
	context.Background(),
	instance.ID,
	linodego.InstanceUpdateOptions{
		Group: &group,
	},
)

fmt.Printf("instance group: '%s'", instance.Group)

Expected result: instance group: ''

@zliang-akamai zliang-akamai requested a review from a team as a code owner February 14, 2024 18:36
@zliang-akamai zliang-akamai requested review from jriddle-linode and ykim-1 and removed request for a team February 14, 2024 18:36
@zliang-akamai zliang-akamai changed the title Zhiwei/deprecate group Deprecate Group Field of Instance Options; Retype Group to be String Pointer Feb 14, 2024
@zliang-akamai zliang-akamai changed the title Deprecate Group Field of Instance Options; Retype Group to be String Pointer Deprecate Group Field of Instance Options; Retype Group in InstanceUpdateOptions to be String Pointer Feb 14, 2024
@zliang-akamai zliang-akamai added the breaking-change for breaking changes in the changelog. label Feb 14, 2024
@zliang-akamai zliang-akamai requested review from a team, lgarber-akamai and yec-akamai and removed request for a team February 14, 2024 18:40
@zliang-akamai zliang-akamai added bugfix for any bug fixes in the changelog. and removed bug labels Feb 16, 2024
instances.go Outdated Show resolved Hide resolved
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.

LGTM, nice work! We'll need to make sure we communicate that this is a breaking change in the release notes given how wide-reaching it is.

Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

Nice work! Tests passed locally

@zliang-akamai zliang-akamai merged commit 852aace into linode:main Feb 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change for breaking changes in the changelog. bugfix for any bug fixes in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants