Skip to content

Commit

Permalink
feat: Define a unified storage interface for storage backend integrat…
Browse files Browse the repository at this point in the history
  • Loading branch information
CH3CHO authored Jan 31, 2024
1 parent e5ea75f commit 440ce7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/apiserver/pkg/registry/file_rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewFileREST(
newFunc func() runtime.Object,
newListFunc func() runtime.Object,
attrFunc storage.AttrFunc,
) (rest.Storage, error) {
) (REST, error) {
if attrFunc == nil {
if isNamespaced {
if isNamespaced {
Expand Down
2 changes: 1 addition & 1 deletion src/apiserver/pkg/registry/nacos_rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func NewNacosREST(
newListFunc func() runtime.Object,
attrFunc storage.AttrFunc,
dataEncryptionKey []byte,
) rest.Storage {
) REST {
if attrFunc == nil {
if isNamespaced {
if isNamespaced {
Expand Down
8 changes: 6 additions & 2 deletions src/apiserver/pkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
)

// REST implements a RESTStorage for API services against etcd
type REST struct {
// REST defines a storage interface for integrating different storage backends with api server.
type REST interface {
rest.Storage
rest.StandardStorage
rest.SingularNameProvider
rest.Scoper
rest.TableConvertor
}

// RESTInPeace is just a simple function that panics on error.
Expand Down

0 comments on commit 440ce7c

Please sign in to comment.