-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_role_definition
- swap to typed sdk
#23679
azurerm_role_definition
- swap to typed sdk
#23679
Conversation
@ziyeqf why are we changing the Resource ID for this resource? |
I'm trying to swap it to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regardless whether we want the resource id migration, I've reviewed the PR and left some comments. Once these are resolved, we can take another look!
internal/services/authorization/migration/role_definition_migration_test.go
Outdated
Show resolved
Hide resolved
internal/services/authorization/migration/role_definition_migration_test.go
Outdated
Show resolved
Hide resolved
internal/services/authorization/role_assignment_resource_base.go
Outdated
Show resolved
Hide resolved
@ziyeqf One more comment is that we might want to split this PR to 3 PRs: one to migrate it to the typed sdk and |
code updated, I will append the new test result here migration test
role definition
|
Signed-off-by: ziyeqf <[email protected]>
azurerm_role_definition
: swap to typed sdk & swap to go-azure-sdk
& migrate resource idazurerm_role_definition
: swap to typed sdk
03e4442
to
01c8e59
Compare
Signed-off-by: ziyeqf <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR @ziyeqf. I left a few very minor comments which would be helpful for us if you looked at.
Although the tests are passing, from memory role definition is problematic resource, so I'd like to have another member of the team review it too.
func dataSourceArmRoleDefinition() *pluginsdk.Resource { | ||
return &pluginsdk.Resource{ | ||
Read: dataSourceArmRoleDefinitionRead, | ||
type ArmRoleDefinitionDataSource struct{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arm..
is a legacy naming pattern in the provider. This would be a good opportunity to remove it, can you please rename this to
type ArmRoleDefinitionDataSource struct{} | |
type RoleDefinitionDataSource struct{} |
Read: resourceArmRoleDefinitionRead, | ||
Update: resourceArmRoleDefinitionUpdate, | ||
Delete: resourceArmRoleDefinitionDelete, | ||
type ArmRoleDefinitionResource struct{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same rename here
type ArmRoleDefinitionResource struct{} | |
type RoleDefinitionResource struct{} |
return err | ||
} | ||
if read.ID == nil || *read.ID == "" { | ||
return fmt.Errorf("Cannot read Role Definition ID for %q (Scope %q)", config.Name, config.Scope) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beginning of error messages should be lowercased
return fmt.Errorf("Cannot read Role Definition ID for %q (Scope %q)", config.Name, config.Scope) | |
return fmt.Errorf("cannot read Role Definition ID for %q (Scope %q)", config.Name, config.Scope) |
azurerm_role_definition
: swap to typed sdkazurerm_role_definition
- swap to typed sdk
Just finished the rename which I should do earlier... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finishing up the changes @ziyeqf - This LGTM 👍
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
To make the PR clear, only swap to typed sdk in this PR. Then there will be another 3 PRs, to swap to go-azure-sdk, to upgrade sdk version, and adding feature.
test