Merge pull request #1159 from johscheuer/fix-release-1.4-test
Add ScheduledJob to validationreviewable/pr1087/r5
commit
ee28f8db6f
|
@ -29,6 +29,7 @@ import (
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
"k8s.io/kubernetes/pkg/api/validation"
|
"k8s.io/kubernetes/pkg/api/validation"
|
||||||
"k8s.io/kubernetes/pkg/apis/batch"
|
"k8s.io/kubernetes/pkg/apis/batch"
|
||||||
|
batch_validation "k8s.io/kubernetes/pkg/apis/batch/validation"
|
||||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||||
expvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation"
|
expvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation"
|
||||||
"k8s.io/kubernetes/pkg/capabilities"
|
"k8s.io/kubernetes/pkg/capabilities"
|
||||||
|
@ -126,6 +127,11 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
|
||||||
t.Namespace = api.NamespaceDefault
|
t.Namespace = api.NamespaceDefault
|
||||||
}
|
}
|
||||||
errors = expvalidation.ValidateDaemonSet(t)
|
errors = expvalidation.ValidateDaemonSet(t)
|
||||||
|
case *batch.ScheduledJob:
|
||||||
|
if t.Namespace == "" {
|
||||||
|
t.Namespace = api.NamespaceDefault
|
||||||
|
}
|
||||||
|
errors = batch_validation.ValidateScheduledJob(t)
|
||||||
default:
|
default:
|
||||||
errors = field.ErrorList{}
|
errors = field.ErrorList{}
|
||||||
errors = append(errors, field.InternalError(field.NewPath(""), fmt.Errorf("no validation defined for %#v", obj)))
|
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-resource-deployment": &extensions.Deployment{},
|
||||||
"redis-secret-deployment": &extensions.Deployment{},
|
"redis-secret-deployment": &extensions.Deployment{},
|
||||||
"run-my-nginx": &extensions.Deployment{},
|
"run-my-nginx": &extensions.Deployment{},
|
||||||
|
"sj": &batch.ScheduledJob{},
|
||||||
},
|
},
|
||||||
"../docs/admin": {
|
"../docs/admin": {
|
||||||
"daemon": &extensions.DaemonSet{},
|
"daemon": &extensions.DaemonSet{},
|
||||||
|
|
Loading…
Reference in New Issue