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

Allowed larger numbers for azurerm_shared_image_version name #2301

Merged
merged 1 commit into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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