Skip to content

Conversation

otherchen
Copy link
Collaborator

This article provides a good initial explanation of the expected behaviors of the different CRUD methods for a resource.

In it, it mentions that the Read method should be able to gracefully handle when the resource no longer exists (probably due to manual deletion).

I also fixed a bug where resourceGroup was supposed to be resource_group and also modified petoju --> zph in certain places. This makes error logs a bit more clear.

if err != nil {
return diag.FromErr(err)
}
// TODO: check for users assigned as safety? and assert zero?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This already happens at the TiDB layer - it doesn't let you delete a resource group if it is still assigned to a user.


d.Set("user", user)
d.Set("resourceGroup", resourceGroup)
d.Set("resource_group", resourceGroup)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was resulting in weird tf diffs - fixing so that we see the correct rg state!

@zph zph merged commit cc4f335 into r3.0.62 Jul 23, 2024
@zph zph deleted the ac-resource-controls-graceful-diff-v2 branch July 23, 2024 21:01
@zph zph restored the ac-resource-controls-graceful-diff-v2 branch July 23, 2024 21:01
@zph zph deleted the ac-resource-controls-graceful-diff-v2 branch July 23, 2024 21:01
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.

2 participants