Validate checks Options and return a slice of found errs.
()
| 21 | |
| 22 | // Validate checks Options and return a slice of found errs. |
| 23 | func (o *Options) Validate() field.ErrorList { |
| 24 | errs := field.ErrorList{} |
| 25 | newPath := field.NewPath("Options") |
| 26 | |
| 27 | if o.CoreWorkerLimit < 0 { |
| 28 | errs = append(errs, field.Invalid(newPath.Child("CoreWorkerLimit"), o.MaxWorkerLimit, "core-worker-limit must be greater than or equals 0")) |
| 29 | } |
| 30 | |
| 31 | if o.MaxWorkerLimit < 0 { |
| 32 | errs = append(errs, field.Invalid(newPath.Child("MaxWorkerLimit"), o.MaxWorkerLimit, "max-worker-limit must be greater than or equals 0")) |
| 33 | } |
| 34 | |
| 35 | return errs |
| 36 | } |
no outgoing calls
no test coverage detected