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) {