cloudapi: validate Disk customization before returining
After converting a Disk customization from the API type to the Blueprint equivalent, run the validator and return an error if it fails to validate. The schema doesn't catch all invalid cases, such as the mountpoint being required when the fs_type is not "swap", so calling the validator ensures that any such cases are caught without needing to duplicate the checks.
This commit is contained in:
parent
ea0b5e8661
commit
45929efbcf
1 changed files with 1 additions and 1 deletions
|
|
@ -1433,7 +1433,7 @@ func convertDiskCustomizations(disk *Disk) (*blueprint.DiskCustomization, error)
|
|||
}
|
||||
bpDisk.Partitions = append(bpDisk.Partitions, bpPartition)
|
||||
}
|
||||
return bpDisk, nil
|
||||
return bpDisk, bpDisk.Validate()
|
||||
}
|
||||
|
||||
func decodeMinsize(size *Minsize) (uint64, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue