From 039af4a5697fbf10542175d3ccde03d5f25b2a3f Mon Sep 17 00:00:00 2001 From: derekwaynecarr Date: Mon, 24 Nov 2014 14:15:22 -0500 Subject: [PATCH] Endpoint.Namespace is not being set when it has no resolved pods --- pkg/registry/endpoint/rest.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/registry/endpoint/rest.go b/pkg/registry/endpoint/rest.go index ac5c2c0e77d..e409bf6d104 100644 --- a/pkg/registry/endpoint/rest.go +++ b/pkg/registry/endpoint/rest.go @@ -67,7 +67,9 @@ func (rs *REST) Create(ctx api.Context, obj runtime.Object) (<-chan apiserver.RE if len(endpoints.Name) == 0 { return nil, fmt.Errorf("id is required: %#v", obj) } - + if !api.ValidNamespace(ctx, &endpoints.ObjectMeta) { + return nil, errors.NewConflict("endpoints", endpoints.Namespace, fmt.Errorf("Endpoints.Namespace does not match the provided context")) + } api.FillObjectMetaSystemFields(ctx, &endpoints.ObjectMeta) return apiserver.MakeAsync(func() (runtime.Object, error) {