provider/triton: Fix error for VLAN ID validation
Source: https://apidocs.joyent.com/cloudapi/#CreateFabricVLAN This suggests that the check is correct and the error message and description are not, so this commit makes them match the docs.
This commit is contained in:
parent
2b34eb5a39
commit
155e7840ba
|
@ -18,14 +18,14 @@ func resourceVLAN() *schema.Resource {
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"vlan_id": {
|
"vlan_id": {
|
||||||
Description: "number between 2-4095 indicating VLAN ID",
|
Description: "number between 0-4095 indicating VLAN ID",
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
ValidateFunc: func(val interface{}, field string) (warn []string, err []error) {
|
ValidateFunc: func(val interface{}, field string) (warn []string, err []error) {
|
||||||
value := val.(int)
|
value := val.(int)
|
||||||
if value < 0 || value > 4095 {
|
if value < 0 || value > 4095 {
|
||||||
err = append(err, errors.New("id must be between 2 and 4095"))
|
err = append(err, errors.New("vlan_id must be between 0 and 4095"))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue