From e032c3075c728911eb540b53099af0dc3005cf22 Mon Sep 17 00:00:00 2001 From: derekwaynecarr Date: Mon, 29 Sep 2014 17:38:25 -0400 Subject: [PATCH] Fix examples test by setting a context prior to validation --- examples/examples_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/examples_test.go b/examples/examples_test.go index 7e326da08ef..259c8a78833 100644 --- a/examples/examples_test.go +++ b/examples/examples_test.go @@ -32,6 +32,7 @@ import ( ) func validateObject(obj runtime.Object) (errors []error) { + ctx := api.NewDefaultContext() switch t := obj.(type) { case *api.ReplicationController: errors = validation.ValidateManifest(&t.DesiredState.PodTemplate.DesiredState.Manifest) @@ -40,12 +41,14 @@ func validateObject(obj runtime.Object) (errors []error) { errors = append(errors, validateObject(&t.Items[i])...) } case *api.Service: + api.ValidNamespaceOnCreateOrUpdate(ctx, &t.JSONBase) errors = validation.ValidateService(t) case *api.ServiceList: for i := range t.Items { errors = append(errors, validateObject(&t.Items[i])...) } case *api.Pod: + api.ValidNamespaceOnCreateOrUpdate(ctx, &t.JSONBase) errors = validation.ValidateManifest(&t.DesiredState.Manifest) case *api.PodList: for i := range t.Items {