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

azurerm_api_management_policy - fixes an error caused by a migration #23018

Merged
merged 5 commits into from
Aug 21, 2023

Conversation

mbfrahry
Copy link
Member

Fixes #23015

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Thanks @mbfrahry - apart from the goimports issue LGTM 👍

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @mbfrahry one minor comment but otherwise LGTM 🍶

@@ -20,11 +21,11 @@ type ApiManagementPolicyV0ToV1 struct{}

func (ApiManagementPolicyV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
apiMgmtId, err := policy.ParseServiceID(rawState["id"].(string))
apiMgmtId, err := parse.ApiManagementID(rawState["id"].(string))
Copy link
Member

Choose a reason for hiding this comment

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

I think these two IDs are identical and we don't need to revert this back to using the older generated parsers which imo we should be removing after doing sdk swaps.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right! I'll change that up now. Thank you thank you

@mbfrahry mbfrahry merged commit afaf4ae into main Aug 21, 2023
20 checks passed
@mbfrahry mbfrahry deleted the api-policy-migration-fix branch August 21, 2023 16:57
@mbfrahry mbfrahry added this to the v3.71.0 milestone Aug 21, 2023
mbfrahry added a commit that referenced this pull request Aug 21, 2023
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Microsoft.ApiManagement Error: unexpected segment "policies/policy"
4 participants