Merge pull request #2570 from derekwaynecarr/endpoints_missing_ns

Endpoint.Namespace is not being set when it has no resolved endpoints
This commit is contained in:
Eric Tune 2014-11-25 11:38:51 -08:00
commit ef85243f73

View File

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