-
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_shared_image
- Support for purchase_plan
#8124
azurerm_shared_image
- Support for purchase_plan
#8124
Conversation
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.
These changes are nearly there! Just a few catches around ForceNew and some doc changes
@@ -344,3 +374,53 @@ func flattenGalleryImageIdentifier(input *compute.GalleryImageIdentifier) []inte | |||
}, | |||
} | |||
} | |||
|
|||
func expandGalleryImagePurchasePlan(input []interface{}) *compute.ImagePurchasePlan { | |||
if len(input) == 0 { |
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.
We'll want to check that input[0] doesn't equal nil as well so we don't panic
if len(input) == 0 { | |
if len(input) == 0 && input[0] != nil { |
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.
I suppose this should be
if len(input) == 0 { | |
if len(input) == 0 || input[0] == nil { |
if we are doing a nil check here?
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.
And I suppose since the name
attribute in this block is required, the situation input[0] == nil
will never happen, right?
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.
But I still added this check for safety
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.
Oh yes! Thanks for catching that ||
instead of &&
. We should check even if should never happen as a just in case.
Hi @mbfrahry I have made some changes, please have a look, thanks! |
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.
LGTM!
azurerm_shared_image
- Support purchase_plan
azurerm_shared_image
- Support purchase_plan
azurerm_shared_image
- Support purchase_plan
azurerm_shared_image
- Support for purchase_plan
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! |
Fixes #7962