Skip to content

Commit

Permalink
Merge pull request #1159 from johscheuer/fix-release-1.4-test
Browse files Browse the repository at this point in the history
Add ScheduledJob to validation
  • Loading branch information
janetkuo authored Sep 7, 2016
2 parents 9666d08 + 038ece1 commit ee28f8d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)))
Expand Down Expand Up @@ -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{},
Expand Down

0 comments on commit ee28f8d

Please sign in to comment.