Merge pull request #1159 from johscheuer/fix-release-1.4-test

Add ScheduledJob to validation
reviewable/pr1087/r5
Janet Kuo 2016-09-07 15:15:38 -07:00 committed by GitHub
commit ee28f8db6f
1 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import (
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/validation"
"k8s.io/kubernetes/pkg/apis/batch"
batch_validation "k8s.io/kubernetes/pkg/apis/batch/validation"
"k8s.io/kubernetes/pkg/apis/extensions"
expvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation"
"k8s.io/kubernetes/pkg/capabilities"
@ -126,6 +127,11 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
t.Namespace = api.NamespaceDefault
}
errors = expvalidation.ValidateDaemonSet(t)
case *batch.ScheduledJob:
if t.Namespace == "" {
t.Namespace = api.NamespaceDefault
}
errors = batch_validation.ValidateScheduledJob(t)
default:
errors = field.ErrorList{}
errors = append(errors, field.InternalError(field.NewPath(""), fmt.Errorf("no validation defined for %#v", obj)))
@ -236,6 +242,7 @@ func TestExampleObjectSchemas(t *testing.T) {
"redis-resource-deployment": &extensions.Deployment{},
"redis-secret-deployment": &extensions.Deployment{},
"run-my-nginx": &extensions.Deployment{},
"sj": &batch.ScheduledJob{},
},
"../docs/admin": {
"daemon": &extensions.DaemonSet{},