Skip to content

Commit

Permalink
Remove older names
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Mar 23, 2015
1 parent d46087d commit 5a3f0ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 45 deletions.
17 changes: 2 additions & 15 deletions pkg/registry/namespace/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
)

Expand All @@ -41,26 +40,14 @@ type Registry interface {
DeleteNamespace(ctx api.Context, namespaceID string) error
}

// Storage is an interface for a standard REST Storage backend
// TODO: move me somewhere common
type Storage interface {
rest.GracefulDeleter
rest.Lister
rest.Getter
rest.Watcher

Create(ctx api.Context, obj runtime.Object) (runtime.Object, error)
Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error)
}

// storage puts strong typing around storage calls
type storage struct {
Storage
rest.StandardStorage
}

// NewRegistry returns a new Registry interface for the given Storage. Any mismatched
// types will panic.
func NewRegistry(s Storage) Registry {
func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s}
}

Expand Down
17 changes: 2 additions & 15 deletions pkg/registry/pod/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
)

Expand All @@ -41,26 +40,14 @@ type Registry interface {
DeletePod(ctx api.Context, podID string) error
}

// Storage is an interface for a standard REST Storage backend
// TODO: move me somewhere common
type Storage interface {
rest.GracefulDeleter
rest.Lister
rest.Getter
rest.Watcher

Create(ctx api.Context, obj runtime.Object) (runtime.Object, error)
Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error)
}

// storage puts strong typing around storage calls
type storage struct {
Storage
rest.StandardStorage
}

// NewRegistry returns a new Registry interface for the given Storage. Any mismatched
// types will panic.
func NewRegistry(s Storage) Registry {
func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s}
}

Expand Down
17 changes: 2 additions & 15 deletions pkg/registry/resourcequota/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
)

Expand All @@ -41,26 +40,14 @@ type Registry interface {
DeleteResourceQuota(ctx api.Context, podID string) error
}

// Storage is an interface for a standard REST Storage backend
// TODO: move me somewhere common
type Storage interface {
rest.GracefulDeleter
rest.Lister
rest.Getter
rest.Watcher

Create(ctx api.Context, obj runtime.Object) (runtime.Object, error)
Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error)
}

// storage puts strong typing around storage calls
type storage struct {
Storage
rest.StandardStorage
}

// NewRegistry returns a new Registry interface for the given Storage. Any mismatched
// types will panic.
func NewRegistry(s Storage) Registry {
func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s}
}

Expand Down

0 comments on commit 5a3f0ad

Please sign in to comment.