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_spring_cloud_gateway - split to create/update functions #24116

Conversation

ms-henglu
Copy link
Contributor

No description provided.

existing, err := client.Get(ctx, id.ResourceGroup, id.SpringName, id.GatewayName)
if err != nil {
if !utils.ResponseWasNotFound(existing.Response) {
return fmt.Errorf("checking for existing %s: %+v", id, err)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("checking for existing %s: %+v", id, err)
return fmt.Errorf("retrieving %s: %+v", id, err)

Comment on lines 401 to 411
if utils.ResponseWasNotFound(existing.Response) {
return fmt.Errorf("retreiving %s: resource was not found", id)
}

if existing.Properties == nil {
return fmt.Errorf("retreiving %s: properties was nil", id)
}
properties := existing.Properties

if existing.Sku == nil {
return fmt.Errorf("retreiving %s: sku was nil", id)
Copy link
Member

Choose a reason for hiding this comment

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

Retrieving is mispelled here

Comment on lines 462 to 467
return fmt.Errorf("creating/updating %s: %+v", id, err)
}

if err := future.WaitForCompletionRef(ctx, client.Client); err != nil {
return fmt.Errorf("waiting for creation/update of %s: %+v", id, err)
}
Copy link
Member

Choose a reason for hiding this comment

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

Please update the error messages in the create as well

Suggested change
return fmt.Errorf("creating/updating %s: %+v", id, err)
}
if err := future.WaitForCompletionRef(ctx, client.Client); err != nil {
return fmt.Errorf("waiting for creation/update of %s: %+v", id, err)
}
return fmt.Errorf("updating %s: %+v", id, err)
}
if err := future.WaitForCompletionRef(ctx, client.Client); err != nil {
return fmt.Errorf("waiting for update of %s: %+v", id, err)
}

@ms-henglu
Copy link
Contributor Author

Hi @stephybun ,

Thanks for the code review! I've updated this PR as suggested, please take another look.

Comment on lines 402 to 406
return fmt.Errorf("retreiving %s: resource was not found", id)
}

if existing.Properties == nil {
return fmt.Errorf("retreiving %s: properties was nil", id)
Copy link
Member

Choose a reason for hiding this comment

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

still misspelled here

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 @ms-henglu LGTM 👍

@stephybun stephybun merged commit fbf55e9 into hashicorp:main Dec 6, 2023
22 checks passed
@github-actions github-actions bot added this to the v3.84.0 milestone Dec 6, 2023
Copy link

github-actions bot commented May 5, 2024

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 5, 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.

2 participants