Add validation function for pool argument of disk resource

This commit is contained in:
Sergey Shubin svs1370
2021-10-02 10:15:32 +03:00
parent 92c52794d4
commit d0fdf38473
2 changed files with 6 additions and 0 deletions

View File

@@ -214,6 +214,7 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
ValidateFunc: validation.IntAtLeast(1),
Description: "Storage end-point provider serving this disk. Cannot be changed for existing disk.",
},
@@ -221,12 +222,14 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringIsNotEmpty,
Description: "Pool where this disk is located. Cannot be changed for existing disk.",
},
"size": {
Type: schema.TypeInt,
Required: true,
ValidateFunc: validation.IntAtLeast(1),
Description: "Size of the disk in GB. Note, that existing disks can only be grown in size.",
},