Fix volume name validation (#400)

PR #386 introduced validation of volume names that disallows dashes,
which is allowed according to DigitalOcean's API documentation: https://developers.digitalocean.com/documentation/v2/#block-storage
This commit is contained in:
Tommy Brunn 2020-03-19 15:14:44 +01:00 committed by GitHub
parent 8d10c8bd0d
commit aa45e68626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ func resourceDigitalOceanVolume() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-z0-9]+$`), "Names must be lowercase and alphanumeric"),
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-z0-9\-]+$`), "Names must be lowercase and be composed only of numbers, letters and \"-\"."),
},
"urn": {
Type: schema.TypeString,