remove ValidateJobSpec and add more test cases to batch validation
This commit is contained in:
@@ -545,14 +545,6 @@ func validateTimeZone(timeZone *string, fldPath *field.Path) field.ErrorList {
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// ValidateJobTemplate validates a JobTemplate and returns an ErrorList with any errors.
|
||||
func ValidateJobTemplate(job *batch.JobTemplate, opts apivalidation.PodValidationOptions) field.ErrorList {
|
||||
// this method should be identical to ValidateJob
|
||||
allErrs := apivalidation.ValidateObjectMeta(&job.ObjectMeta, true, apivalidation.ValidateReplicationControllerName, field.NewPath("metadata"))
|
||||
allErrs = append(allErrs, ValidateJobTemplateSpec(&job.Template, field.NewPath("template"), opts)...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// ValidateJobTemplateSpec validates a JobTemplateSpec and returns an ErrorList with any errors.
|
||||
func ValidateJobTemplateSpec(spec *batch.JobTemplateSpec, fldPath *field.Path, opts apivalidation.PodValidationOptions) field.ErrorList {
|
||||
allErrs := validateJobSpec(&spec.Spec, fldPath.Child("spec"), opts)
|
||||
|
Reference in New Issue
Block a user