Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Fix HTTP verbs supported by serviceinstances/status (#1302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Boyd authored and pmorie committed Sep 30, 2017
1 parent 44ff690 commit b26491e
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion pkg/registry/servicecatalog/instance/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/generic/registry"
"k8s.io/apiserver/pkg/registry/rest"
Expand Down Expand Up @@ -143,5 +144,27 @@ func NewStorage(opts server.Options) (rest.Storage, rest.Storage) {
statusStore := store
statusStore.UpdateStrategy = instanceStatusUpdateStrategy

return &store, &statusStore
return &store, &StatusREST{&statusStore}
}

// StatusREST defines the REST operations for the status subresource.
type StatusREST struct {
store *registry.Store
}

// New returns a new ServiceInstance
func (r *StatusREST) New() runtime.Object {
return &servicecatalog.ServiceInstance{}
}

// Get retrieves the object from the storage. It is required to support Patch
// and to implement the rest.Getter interface.
func (r *StatusREST) Get(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
return r.store.Get(ctx, name, options)
}

// Update alters the status subset of an object and it
// implements rest.Updater interface
func (r *StatusREST) Update(ctx genericapirequest.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
return r.store.Update(ctx, name, objInfo)
}

0 comments on commit b26491e

Please sign in to comment.