Split RESTStorage into separate interfaces
Omit unimplemented interfaces from Swagger
This commit is contained in:
@@ -122,6 +122,10 @@ func (*REST) New() runtime.Object {
|
||||
return &api.ReplicationController{}
|
||||
}
|
||||
|
||||
func (*REST) NewList() runtime.Object {
|
||||
return &api.ReplicationControllerList{}
|
||||
}
|
||||
|
||||
// Update replaces a given ReplicationController instance with an existing
|
||||
// instance in storage.registry.
|
||||
func (rs *REST) Update(ctx api.Context, obj runtime.Object) (<-chan apiserver.RESTResult, error) {
|
||||
|
||||
@@ -105,3 +105,7 @@ func (rs *REST) Delete(ctx api.Context, id string) (<-chan apiserver.RESTResult,
|
||||
func (rs REST) New() runtime.Object {
|
||||
return &api.Endpoints{}
|
||||
}
|
||||
|
||||
func (*REST) NewList() runtime.Object {
|
||||
return &api.EndpointsList{}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,10 @@ func (*REST) New() runtime.Object {
|
||||
return &api.Event{}
|
||||
}
|
||||
|
||||
func (*REST) NewList() runtime.Object {
|
||||
return &api.EventList{}
|
||||
}
|
||||
|
||||
// Update returns an error: Events are not mutable.
|
||||
func (rs *REST) Update(ctx api.Context, obj runtime.Object) (<-chan apiserver.RESTResult, error) {
|
||||
return nil, fmt.Errorf("not allowed: 'Event' objects are not mutable")
|
||||
|
||||
@@ -104,6 +104,10 @@ func (rs *REST) New() runtime.Object {
|
||||
return &api.Node{}
|
||||
}
|
||||
|
||||
func (*REST) NewList() runtime.Object {
|
||||
return &api.NodeList{}
|
||||
}
|
||||
|
||||
// Update satisfies the RESTStorage interface.
|
||||
func (rs *REST) Update(ctx api.Context, obj runtime.Object) (<-chan apiserver.RESTResult, error) {
|
||||
minion, ok := obj.(*api.Node)
|
||||
|
||||
@@ -161,6 +161,10 @@ func (*REST) New() runtime.Object {
|
||||
return &api.Pod{}
|
||||
}
|
||||
|
||||
func (*REST) NewList() runtime.Object {
|
||||
return &api.PodList{}
|
||||
}
|
||||
|
||||
func (rs *REST) Update(ctx api.Context, obj runtime.Object) (<-chan apiserver.RESTResult, error) {
|
||||
pod := obj.(*api.Pod)
|
||||
if !api.ValidNamespace(ctx, &pod.ObjectMeta) {
|
||||
|
||||
@@ -217,6 +217,10 @@ func (*REST) New() runtime.Object {
|
||||
return &api.Service{}
|
||||
}
|
||||
|
||||
func (*REST) NewList() runtime.Object {
|
||||
return &api.Service{}
|
||||
}
|
||||
|
||||
func (rs *REST) Update(ctx api.Context, obj runtime.Object) (<-chan apiserver.RESTResult, error) {
|
||||
service := obj.(*api.Service)
|
||||
if !api.ValidNamespace(ctx, &service.ObjectMeta) {
|
||||
|
||||
Reference in New Issue
Block a user