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

Updates tags limits from 15 to 50 per resource #4071

Merged
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
4 changes: 2 additions & 2 deletions azurerm/deprecated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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")
}
}
Expand Down
4 changes: 2 additions & 2 deletions azurerm/internal/tags/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions azurerm/internal/tags/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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")
}
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_storage_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down