Add type-aware backup job forms
This commit is contained in:
@@ -74,6 +74,13 @@ func ValidateJob(j Job) error {
|
||||
return errors.New("source requires path or workloadId")
|
||||
}
|
||||
}
|
||||
if j.Type == JobDocker || j.Type == JobVM {
|
||||
for _, source := range j.Sources {
|
||||
if source.WorkloadID == "" {
|
||||
return errors.New("docker and vm jobs require workload selections")
|
||||
}
|
||||
}
|
||||
}
|
||||
if j.Compression != "auto" && j.Compression != "off" && j.Compression != "max" {
|
||||
return errors.New("compression must be auto, off, or max")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user