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_[linux|windows]_virtual_machine - if the priority property on read is empty assume it to be Regular #6301

Merged
merged 2 commits into from
Apr 7, 2020

Conversation

kazimierzbudzyk
Copy link
Contributor

Fixes: #6300

@ghost ghost added the size/XS label Mar 30, 2020
Copy link
Contributor

@ArcturusZhang ArcturusZhang left a comment

Choose a reason for hiding this comment

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

Hi @kazimierzbudzyk thanks for the PR! A very minor comment which is made to align with the style.
And plus would please also update azurerm_windows_virtual_machine to make sure the two virtual machines align with each other?

Comment on lines 571 to 575
priority := props.Priority
if priority == "" {
priority = compute.Regular
}
d.Set("priority", string(priority))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we please do this by assigning the default value first, and then check if response is empty and then assign the real value if it is empty.

Suggested change
priority := props.Priority
if priority == "" {
priority = compute.Regular
}
d.Set("priority", string(priority))
priority := string(compute.Regular)
if props.Priority != "" {
priority = string(props.Priority)
}
d.Set("priority", priority)

@kazimierzbudzyk
Copy link
Contributor Author

Thank you for the review @ArcturusZhang! Made changes according to your comments.

Copy link
Contributor

@ArcturusZhang ArcturusZhang left a comment

Choose a reason for hiding this comment

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

LGTM now 👍
Some tests on this resource is failing but those look not likely to relate with this change.

@kazimierzbudzyk
Copy link
Contributor Author

Thanks! @ArcturusZhang what is the process for getting this added to a release?

@katbyte katbyte added this to the v2.5.0 milestone Apr 7, 2020
@katbyte katbyte changed the title Fix how empty azurerm_linux_virtual_machine.priority is interpreted azurerm_[linux|window}_virtual_machine] - on read if the priority property is empty assume it is Regular Apr 7, 2020
@katbyte katbyte changed the title azurerm_[linux|window}_virtual_machine] - on read if the priority property is empty assume it is Regular azurerm_[linux|window]_virtual_machine] - on read if the priority property is empty assume it is Regular Apr 7, 2020
@katbyte katbyte changed the title azurerm_[linux|window]_virtual_machine] - on read if the priority property is empty assume it is Regular azurerm_[linux|windows]_virtual_machine - on read if the priority property is empty assume it is Regular Apr 7, 2020
@katbyte katbyte changed the title azurerm_[linux|windows]_virtual_machine - on read if the priority property is empty assume it is Regular azurerm_[linux|windows]_virtual_machine - the priority property on read is empty assume to be Regular Apr 7, 2020
@katbyte katbyte changed the title azurerm_[linux|windows]_virtual_machine - the priority property on read is empty assume to be Regular azurerm_[linux|windows]_virtual_machine - if the priority property on read is empty assume to be Regular Apr 7, 2020
@katbyte katbyte changed the title azurerm_[linux|windows]_virtual_machine - if the priority property on read is empty assume to be Regular azurerm_[linux|windows]_virtual_machine - if the priority property on read is empty assume it to be Regular Apr 7, 2020
@katbyte katbyte merged commit 9b2e343 into hashicorp:master Apr 7, 2020
katbyte added a commit that referenced this pull request Apr 7, 2020
@ghost
Copy link

ghost commented Apr 9, 2020

This has been released in version 2.5.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.5.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented May 7, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators May 7, 2020
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.

Forced recreation after migrating azurerm_virtual_machine -> azurerm_linux_virtual_machine
3 participants