Skip to content

Commit

Permalink
Allowed larger numbers for azurerm_shared_image_version name (#2301)
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte authored and tombuildsstuff committed Nov 13, 2018
1 parent de7effe commit 4e8c56f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion azurerm/helpers/validate/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func SharedImageName(v interface{}, k string) (ws []string, es []error) {
func SharedImageVersionName(v interface{}, k string) (ws []string, es []error) {
value := v.(string)

r, _ := regexp.Compile(`^([0-9]\.[0-9]\.[0-9])$`)
r, _ := regexp.Compile(`^([0-9]{1,10}\.[0-9]{1,10}\.[0-9]{1,10})$`)
if !r.MatchString(value) {
es = append(es, fmt.Errorf("Expected %s to be in the format `1.2.3` but got %q.", k, value))
}
Expand Down
3 changes: 2 additions & 1 deletion azurerm/resource_arm_shared_image_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func TestAccAzureRMSharedImageVersion_basic(t *testing.T) {
testCheckAzureRMSharedImageVersionExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "managed_image_id"),
resource.TestCheckResourceAttr(resourceName, "target_region.#", "2"),
resource.TestCheckResourceAttr(resourceName, "name", "1234567890.1234567890.1234567890"),
),
},
{
Expand Down Expand Up @@ -181,7 +182,7 @@ func testAccAzureRMSharedImageVersion_imageVersionUpdated(rInt int, location, al
%s
resource "azurerm_shared_image_version" "test" {
name = "0.0.1"
name = "1234567890.1234567890.1234567890"
gallery_name = "${azurerm_shared_image_gallery.test.name}"
image_name = "${azurerm_shared_image.test.name}"
resource_group_name = "${azurerm_resource_group.test.name}"
Expand Down

0 comments on commit 4e8c56f

Please sign in to comment.