-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Data source azurerm_shared_image_version is not returning the actual latest version #13175
Comments
I've also stumbled upon this and was quite confused since it was claimed to be fixed in by #10519 in version 2.47.0. However, I definitely still face the same behaviour and I think this is also the same issue as #10581. I also want to add #10516 as a reference from the past where this issue was raised initially. It appears that the fix back then was only applied to As a workaround for now, I use the working # obtain all versions, the last version in that list will be the "latest" version
data "azurerm_shared_image_versions" "versions" {
image_name = "my-shared-image-name"
gallery_name = "my-shared-image-gallery-name"
resource_group_name = "my-resource-group-name"
}
data "azurerm_shared_image_version" "main" {
name = reverse(data.azurerm_shared_image_versions.main.images)[0].name
image_name = "my-shared-image-name"
gallery_name = "my-shared-image-gallery-name"
resource_group_name = "my-resource-group-name"
} This effectively reproduces the behaviour of terraform-provider-azurerm/azurerm/internal/services/compute/shared_image_version_data_source.go Lines 166 to 170 in 6029f71
|
Hello, I'm having issues with this resource since nor the latest or recent parameters work for the name attribute We are using a standardized versioning policy - MAJOR.MINOR.PATCH for our images Current situation: we've built the image versioned to 1.0.10 but 1.0.9 is returned due to a sorting issue Example golang code that could fix this - take into account "numeric" string for versioning
and the resulting output -> where Before is what currently the provider returns
Can somebody take a look at this and fix it upstream if valid? |
Hi and thanks all for reporting this issue. For my understanding - from what I can see in the docs - the version can be anything really, so |
Co-authored-by: Tom Harvey <[email protected]> Fixes #13175
This functionality has been released in v2.91.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Since we have more than 20 images, the API return images in batches and a token to get the latest. However, the provider only find the latest in the first batch. This has been fixed in data source
azurerm_shared_image_versions
Panic Output
Expected Behaviour
Return image of the latest
Actual Behaviour
Return latest image in the first batch
Steps to Reproduce
terraform apply
Important Factoids
References
azurerm_shared_image_version
is not returning the actual latest version when usingname="latest"
#8296The text was updated successfully, but these errors were encountered: