From aaf1b410ef1dec33b01fa39049a386fadc88cebe Mon Sep 17 00:00:00 2001 From: Igor Shenederchuk Date: Tue, 13 Aug 2019 15:42:23 +0300 Subject: [PATCH 1/2] Updates tags limits from 15 to 50 --- azurerm/internal/tags/validation.go | 4 ++-- azurerm/internal/tags/validation_test.go | 4 ++-- azurerm/resource_arm_storage_account.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/azurerm/internal/tags/validation.go b/azurerm/internal/tags/validation.go index b296d302e425..1bca2c7d3e61 100644 --- a/azurerm/internal/tags/validation.go +++ b/azurerm/internal/tags/validation.go @@ -5,8 +5,8 @@ import "fmt" func Validate(v interface{}, _ string) (warnings []string, errors []error) { tagsMap := v.(map[string]interface{}) - if len(tagsMap) > 15 { - errors = append(errors, fmt.Errorf("a maximum of 15 tags can be applied to each ARM resource")) + if len(tagsMap) > 50 { + errors = append(errors, fmt.Errorf("a maximum of 50 tags can be applied to each ARM resource")) } for k, v := range tagsMap { diff --git a/azurerm/internal/tags/validation_test.go b/azurerm/internal/tags/validation_test.go index 293e6960a51c..02f749221046 100644 --- a/azurerm/internal/tags/validation_test.go +++ b/azurerm/internal/tags/validation_test.go @@ -8,7 +8,7 @@ import ( func TestValidateMaximumNumberOfTags(t *testing.T) { tagsMap := make(map[string]interface{}) - for i := 0; i < 16; i++ { + for i := 0; i < 51; i++ { tagsMap[fmt.Sprintf("key%d", i)] = fmt.Sprintf("value%d", i) } @@ -18,7 +18,7 @@ func TestValidateMaximumNumberOfTags(t *testing.T) { t.Fatal("Expected one validation error for too many tags") } - if !strings.Contains(es[0].Error(), "a maximum of 15 tags") { + if !strings.Contains(es[0].Error(), "a maximum of 50 tags") { t.Fatal("Wrong validation error message for too many tags") } } diff --git a/azurerm/resource_arm_storage_account.go b/azurerm/resource_arm_storage_account.go index 7e55f66b8cdc..c28035812142 100644 --- a/azurerm/resource_arm_storage_account.go +++ b/azurerm/resource_arm_storage_account.go @@ -579,7 +579,7 @@ func validateAzureRMStorageAccountTags(v interface{}, _ string) (warnings []stri tagsMap := v.(map[string]interface{}) if len(tagsMap) > 15 { - errors = append(errors, fmt.Errorf("a maximum of 15 tags can be applied to each ARM resource")) + errors = append(errors, fmt.Errorf("a maximum of 15 tags can be applied to storage account ARM resource")) } for k, v := range tagsMap { From ce378864acc4848085b766864fe188bddbade726 Mon Sep 17 00:00:00 2001 From: Igor Shenederchuk Date: Tue, 13 Aug 2019 16:13:59 +0300 Subject: [PATCH 2/2] Updates deprecated_test with new 50 tags limit --- azurerm/deprecated_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/deprecated_test.go b/azurerm/deprecated_test.go index 9c77d3118ced..c563e45aab0b 100644 --- a/azurerm/deprecated_test.go +++ b/azurerm/deprecated_test.go @@ -8,7 +8,7 @@ import ( func TestValidateMaximumNumberOfARMTags(t *testing.T) { tagsMap := make(map[string]interface{}) - for i := 0; i < 16; i++ { + for i := 0; i < 51; i++ { tagsMap[fmt.Sprintf("key%d", i)] = fmt.Sprintf("value%d", i) } @@ -18,7 +18,7 @@ func TestValidateMaximumNumberOfARMTags(t *testing.T) { t.Fatal("Expected one validation error for too many tags") } - if !strings.Contains(es[0].Error(), "a maximum of 15 tags") { + if !strings.Contains(es[0].Error(), "a maximum of 50 tags") { t.Fatal("Wrong validation error message for too many tags") } }