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 add_vpcs and add_placement_groups user grants #1720

Merged
merged 5 commits into from
Feb 5, 2025

Conversation

stvnjacobs
Copy link
Contributor

📝 Description

linodego added support for the add_vpcs and add_placement_group user grants in v1.44.0 (linode/linodego#622). At the time of writing, terraform-provider-linode is on [email protected]. This patch adds support for these fields in the linode_user resource.

✔️ How to Test

I have run make, and make unit-tests, but not run the integration tests. I believe all tests cases were updated, as I followed the same pattern used in other grants.

@stvnjacobs stvnjacobs requested a review from a team as a code owner January 15, 2025 16:30
@stvnjacobs stvnjacobs requested review from ykim-akamai and yec-akamai and removed request for a team January 15, 2025 16:30
resource.TestCheckResourceAttr(testUserResName, "global_grants.0.add_stackscripts", "false"),
resource.TestCheckResourceAttr(testUserResName, "global_grants.0.add_volumes", "false"),
resource.TestCheckResourceAttr(testUserResName, "global_grants.0.add_vpcs", "false"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is what give me the most uncertainty. I confess to not digging to far into how it worked and just chose "false" in both cases.

@stvnjacobs stvnjacobs force-pushed the feat/user-grants-pg-vpc branch 2 times, most recently from 98f08dc to 975aadf Compare January 16, 2025 17:36
@stvnjacobs stvnjacobs force-pushed the feat/user-grants-pg-vpc branch 2 times, most recently from 845787c to a69d4a8 Compare January 28, 2025 19:41
linodego added support for the `add_vpcs` and `add_placement_group` user
grants in v1.44.0 (linode/linodego#622). This
patch adds support for these fields in the `linode_user` resource.
@stvnjacobs stvnjacobs force-pushed the feat/user-grants-pg-vpc branch from a69d4a8 to bc963d5 Compare January 28, 2025 19:42
@zliang-akamai
Copy link
Member

Thanks for your contribution!
The database, placement_group, and vpc user grands are also currently missing in the code base. Would you mind to add them into this PR?

@stvnjacobs
Copy link
Contributor Author

I am sorry, but I don't think I understand. This patch adds this missing add_vpcs and add_placement_group grants. Is this not the placement_group and vpc user grants you are referring to?

@zliang-akamai
Copy link
Member

zliang-akamai commented Jan 31, 2025

@stvnjacobs No worries, there are another group for the non-global user grants, like:
https://github.com/linode/terraform-provider-linode/pull/1720/files#diff-8e90b136858349b782281c73d02ca20475f4ba5133227b9095502e88320bb5baR74-R82

We can handle them after merging this PR.

@stvnjacobs
Copy link
Contributor Author

@zliang-akamai I believe I have satisfied your request, minus the database change.

The database, placement_group, and vpc user grands are also currently missing in the code base. Would you mind to add them into this PR?

I already see someone else added theadd_databases grants and database_grant attributes, so I am not sure what is missing. If it's alright, I'd like to keep this focused on adding the missing VPC and Placement Group pieces, which I believe I did correctly.

This adds the missing `vpc_grant` and `placement_group_grants` to the
user resources and their data sources.
@stvnjacobs stvnjacobs force-pushed the feat/user-grants-pg-vpc branch from b7490e0 to 673dd2d Compare January 31, 2025 14:55
@ykim-akamai
Copy link
Contributor

Looks good, just one unit test failure in the latest commit FAIL: TestParseUserGrants (0.00s)

Copy link
Contributor

@ykim-akamai ykim-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!

@zliang-akamai zliang-akamai merged commit a4b21ab into linode:dev Feb 5, 2025
8 checks passed
@zliang-akamai zliang-akamai added the new-feature for new features in the changelog. label Feb 5, 2025
@stvnjacobs stvnjacobs deleted the feat/user-grants-pg-vpc branch February 10, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants