Update registries to use metainternalversion list options

This commit is contained in:
Clayton Coleman 2017-01-21 17:18:48 -05:00
parent 3ba366fcf1
commit a35be4e02e
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3
22 changed files with 99 additions and 77 deletions

View File

@ -17,6 +17,7 @@ limitations under the License.
package cluster package cluster
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -27,8 +28,8 @@ import (
// Registry is an interface implemented by things that know how to store Cluster objects. // Registry is an interface implemented by things that know how to store Cluster objects.
type Registry interface { type Registry interface {
ListClusters(ctx genericapirequest.Context, options *api.ListOptions) (*federation.ClusterList, error) ListClusters(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*federation.ClusterList, error)
WatchCluster(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchCluster(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
GetCluster(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*federation.Cluster, error) GetCluster(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*federation.Cluster, error)
CreateCluster(ctx genericapirequest.Context, cluster *federation.Cluster) error CreateCluster(ctx genericapirequest.Context, cluster *federation.Cluster) error
UpdateCluster(ctx genericapirequest.Context, cluster *federation.Cluster) error UpdateCluster(ctx genericapirequest.Context, cluster *federation.Cluster) error
@ -46,7 +47,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListClusters(ctx genericapirequest.Context, options *api.ListOptions) (*federation.ClusterList, error) { func (s *storage) ListClusters(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*federation.ClusterList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -54,7 +55,7 @@ func (s *storage) ListClusters(ctx genericapirequest.Context, options *api.ListO
return obj.(*federation.ClusterList), nil return obj.(*federation.ClusterList), nil
} }
func (s *storage) WatchCluster(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchCluster(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package certificates package certificates
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -27,12 +28,12 @@ import (
// Registry is an interface for things that know how to store CSRs. // Registry is an interface for things that know how to store CSRs.
type Registry interface { type Registry interface {
ListCSRs(ctx genericapirequest.Context, options *api.ListOptions) (*certificates.CertificateSigningRequestList, error) ListCSRs(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*certificates.CertificateSigningRequestList, error)
CreateCSR(ctx genericapirequest.Context, csr *certificates.CertificateSigningRequest) error CreateCSR(ctx genericapirequest.Context, csr *certificates.CertificateSigningRequest) error
UpdateCSR(ctx genericapirequest.Context, csr *certificates.CertificateSigningRequest) error UpdateCSR(ctx genericapirequest.Context, csr *certificates.CertificateSigningRequest) error
GetCSR(ctx genericapirequest.Context, csrID string, options *metav1.GetOptions) (*certificates.CertificateSigningRequest, error) GetCSR(ctx genericapirequest.Context, csrID string, options *metav1.GetOptions) (*certificates.CertificateSigningRequest, error)
DeleteCSR(ctx genericapirequest.Context, csrID string) error DeleteCSR(ctx genericapirequest.Context, csrID string) error
WatchCSRs(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchCSRs(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
} }
// storage puts strong typing around storage calls // storage puts strong typing around storage calls
@ -46,7 +47,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListCSRs(ctx genericapirequest.Context, options *api.ListOptions) (*certificates.CertificateSigningRequestList, error) { func (s *storage) ListCSRs(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*certificates.CertificateSigningRequestList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -65,7 +66,7 @@ func (s *storage) UpdateCSR(ctx genericapirequest.Context, csr *certificates.Cer
return err return err
} }
func (s *storage) WatchCSRs(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchCSRs(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -20,6 +20,7 @@ import (
"fmt" "fmt"
"sync" "sync"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -51,7 +52,7 @@ func (rs *REST) NewList() runtime.Object {
// Returns the list of component status. Note that the label and field are both ignored. // Returns the list of component status. Note that the label and field are both ignored.
// Note that this call doesn't support labels or selectors. // Note that this call doesn't support labels or selectors.
func (rs *REST) List(ctx genericapirequest.Context, options *api.ListOptions) (runtime.Object, error) { func (rs *REST) List(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (runtime.Object, error) {
servers := rs.GetServersToValidate() servers := rs.GetServersToValidate()
wait := sync.WaitGroup{} wait := sync.WaitGroup{}

View File

@ -17,6 +17,7 @@ limitations under the License.
package configmap package configmap
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -26,8 +27,8 @@ import (
// Registry is an interface for things that know how to store ConfigMaps. // Registry is an interface for things that know how to store ConfigMaps.
type Registry interface { type Registry interface {
ListConfigMaps(ctx genericapirequest.Context, options *api.ListOptions) (*api.ConfigMapList, error) ListConfigMaps(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ConfigMapList, error)
WatchConfigMaps(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchConfigMaps(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
GetConfigMap(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.ConfigMap, error) GetConfigMap(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.ConfigMap, error)
CreateConfigMap(ctx genericapirequest.Context, cfg *api.ConfigMap) (*api.ConfigMap, error) CreateConfigMap(ctx genericapirequest.Context, cfg *api.ConfigMap) (*api.ConfigMap, error)
UpdateConfigMap(ctx genericapirequest.Context, cfg *api.ConfigMap) (*api.ConfigMap, error) UpdateConfigMap(ctx genericapirequest.Context, cfg *api.ConfigMap) (*api.ConfigMap, error)
@ -45,7 +46,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListConfigMaps(ctx genericapirequest.Context, options *api.ListOptions) (*api.ConfigMapList, error) { func (s *storage) ListConfigMaps(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ConfigMapList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -54,7 +55,7 @@ func (s *storage) ListConfigMaps(ctx genericapirequest.Context, options *api.Lis
return obj.(*api.ConfigMapList), err return obj.(*api.ConfigMapList), err
} }
func (s *storage) WatchConfigMaps(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchConfigMaps(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -21,6 +21,7 @@ package controller
import ( import (
"fmt" "fmt"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -30,8 +31,8 @@ import (
// Registry is an interface for things that know how to store ReplicationControllers. // Registry is an interface for things that know how to store ReplicationControllers.
type Registry interface { type Registry interface {
ListControllers(ctx genericapirequest.Context, options *api.ListOptions) (*api.ReplicationControllerList, error) ListControllers(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ReplicationControllerList, error)
WatchControllers(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchControllers(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
GetController(ctx genericapirequest.Context, controllerID string, options *metav1.GetOptions) (*api.ReplicationController, error) GetController(ctx genericapirequest.Context, controllerID string, options *metav1.GetOptions) (*api.ReplicationController, error)
CreateController(ctx genericapirequest.Context, controller *api.ReplicationController) (*api.ReplicationController, error) CreateController(ctx genericapirequest.Context, controller *api.ReplicationController) (*api.ReplicationController, error)
UpdateController(ctx genericapirequest.Context, controller *api.ReplicationController) (*api.ReplicationController, error) UpdateController(ctx genericapirequest.Context, controller *api.ReplicationController) (*api.ReplicationController, error)
@ -49,7 +50,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListControllers(ctx genericapirequest.Context, options *api.ListOptions) (*api.ReplicationControllerList, error) { func (s *storage) ListControllers(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ReplicationControllerList, error) {
if options != nil && options.FieldSelector != nil && !options.FieldSelector.Empty() { if options != nil && options.FieldSelector != nil && !options.FieldSelector.Empty() {
return nil, fmt.Errorf("field selector not supported yet") return nil, fmt.Errorf("field selector not supported yet")
} }
@ -60,7 +61,7 @@ func (s *storage) ListControllers(ctx genericapirequest.Context, options *api.Li
return obj.(*api.ReplicationControllerList), err return obj.(*api.ReplicationControllerList), err
} }
func (s *storage) WatchControllers(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchControllers(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package endpoint package endpoint
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -26,9 +27,9 @@ import (
// Registry is an interface for things that know how to store endpoints. // Registry is an interface for things that know how to store endpoints.
type Registry interface { type Registry interface {
ListEndpoints(ctx genericapirequest.Context, options *api.ListOptions) (*api.EndpointsList, error) ListEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.EndpointsList, error)
GetEndpoints(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.Endpoints, error) GetEndpoints(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.Endpoints, error)
WatchEndpoints(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
UpdateEndpoints(ctx genericapirequest.Context, e *api.Endpoints) error UpdateEndpoints(ctx genericapirequest.Context, e *api.Endpoints) error
DeleteEndpoints(ctx genericapirequest.Context, name string) error DeleteEndpoints(ctx genericapirequest.Context, name string) error
} }
@ -44,7 +45,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListEndpoints(ctx genericapirequest.Context, options *api.ListOptions) (*api.EndpointsList, error) { func (s *storage) ListEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.EndpointsList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -52,7 +53,7 @@ func (s *storage) ListEndpoints(ctx genericapirequest.Context, options *api.List
return obj.(*api.EndpointsList), nil return obj.(*api.EndpointsList), nil
} }
func (s *storage) WatchEndpoints(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package namespace package namespace
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -26,8 +27,8 @@ import (
// Registry is an interface implemented by things that know how to store Namespace objects. // Registry is an interface implemented by things that know how to store Namespace objects.
type Registry interface { type Registry interface {
ListNamespaces(ctx genericapirequest.Context, options *api.ListOptions) (*api.NamespaceList, error) ListNamespaces(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.NamespaceList, error)
WatchNamespaces(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchNamespaces(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
GetNamespace(ctx genericapirequest.Context, namespaceID string, options *metav1.GetOptions) (*api.Namespace, error) GetNamespace(ctx genericapirequest.Context, namespaceID string, options *metav1.GetOptions) (*api.Namespace, error)
CreateNamespace(ctx genericapirequest.Context, namespace *api.Namespace) error CreateNamespace(ctx genericapirequest.Context, namespace *api.Namespace) error
UpdateNamespace(ctx genericapirequest.Context, namespace *api.Namespace) error UpdateNamespace(ctx genericapirequest.Context, namespace *api.Namespace) error
@ -45,7 +46,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListNamespaces(ctx genericapirequest.Context, options *api.ListOptions) (*api.NamespaceList, error) { func (s *storage) ListNamespaces(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.NamespaceList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -53,7 +54,7 @@ func (s *storage) ListNamespaces(ctx genericapirequest.Context, options *api.Lis
return obj.(*api.NamespaceList), nil return obj.(*api.NamespaceList), nil
} }
func (s *storage) WatchNamespaces(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchNamespaces(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package node package node
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -26,12 +27,12 @@ import (
// Registry is an interface for things that know how to store node. // Registry is an interface for things that know how to store node.
type Registry interface { type Registry interface {
ListNodes(ctx genericapirequest.Context, options *api.ListOptions) (*api.NodeList, error) ListNodes(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.NodeList, error)
CreateNode(ctx genericapirequest.Context, node *api.Node) error CreateNode(ctx genericapirequest.Context, node *api.Node) error
UpdateNode(ctx genericapirequest.Context, node *api.Node) error UpdateNode(ctx genericapirequest.Context, node *api.Node) error
GetNode(ctx genericapirequest.Context, nodeID string, options *metav1.GetOptions) (*api.Node, error) GetNode(ctx genericapirequest.Context, nodeID string, options *metav1.GetOptions) (*api.Node, error)
DeleteNode(ctx genericapirequest.Context, nodeID string) error DeleteNode(ctx genericapirequest.Context, nodeID string) error
WatchNodes(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchNodes(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
} }
// storage puts strong typing around storage calls // storage puts strong typing around storage calls
@ -45,7 +46,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListNodes(ctx genericapirequest.Context, options *api.ListOptions) (*api.NodeList, error) { func (s *storage) ListNodes(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.NodeList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -64,7 +65,7 @@ func (s *storage) UpdateNode(ctx genericapirequest.Context, node *api.Node) erro
return err return err
} }
func (s *storage) WatchNodes(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchNodes(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package secret package secret
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -26,8 +27,8 @@ import (
// Registry is an interface implemented by things that know how to store Secret objects. // Registry is an interface implemented by things that know how to store Secret objects.
type Registry interface { type Registry interface {
ListSecrets(ctx genericapirequest.Context, options *api.ListOptions) (*api.SecretList, error) ListSecrets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.SecretList, error)
WatchSecrets(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchSecrets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
GetSecret(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.Secret, error) GetSecret(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.Secret, error)
CreateSecret(ctx genericapirequest.Context, Secret *api.Secret) (*api.Secret, error) CreateSecret(ctx genericapirequest.Context, Secret *api.Secret) (*api.Secret, error)
UpdateSecret(ctx genericapirequest.Context, Secret *api.Secret) (*api.Secret, error) UpdateSecret(ctx genericapirequest.Context, Secret *api.Secret) (*api.Secret, error)
@ -45,7 +46,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListSecrets(ctx genericapirequest.Context, options *api.ListOptions) (*api.SecretList, error) { func (s *storage) ListSecrets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.SecretList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -53,7 +54,7 @@ func (s *storage) ListSecrets(ctx genericapirequest.Context, options *api.ListOp
return obj.(*api.SecretList), nil return obj.(*api.SecretList), nil
} }
func (s *storage) WatchSecrets(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchSecrets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -19,6 +19,7 @@ package service
import ( import (
"fmt" "fmt"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -28,12 +29,12 @@ import (
// Registry is an interface for things that know how to store services. // Registry is an interface for things that know how to store services.
type Registry interface { type Registry interface {
ListServices(ctx genericapirequest.Context, options *api.ListOptions) (*api.ServiceList, error) ListServices(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ServiceList, error)
CreateService(ctx genericapirequest.Context, svc *api.Service) (*api.Service, error) CreateService(ctx genericapirequest.Context, svc *api.Service) (*api.Service, error)
GetService(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.Service, error) GetService(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.Service, error)
DeleteService(ctx genericapirequest.Context, name string) error DeleteService(ctx genericapirequest.Context, name string) error
UpdateService(ctx genericapirequest.Context, svc *api.Service) (*api.Service, error) UpdateService(ctx genericapirequest.Context, svc *api.Service) (*api.Service, error)
WatchServices(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchServices(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
ExportService(ctx genericapirequest.Context, name string, options metav1.ExportOptions) (*api.Service, error) ExportService(ctx genericapirequest.Context, name string, options metav1.ExportOptions) (*api.Service, error)
} }
@ -48,7 +49,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListServices(ctx genericapirequest.Context, options *api.ListOptions) (*api.ServiceList, error) { func (s *storage) ListServices(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ServiceList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -85,7 +86,7 @@ func (s *storage) UpdateService(ctx genericapirequest.Context, svc *api.Service)
return obj.(*api.Service), nil return obj.(*api.Service), nil
} }
func (s *storage) WatchServices(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchServices(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -26,6 +26,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
utilnet "k8s.io/apimachinery/pkg/util/net" utilnet "k8s.io/apimachinery/pkg/util/net"
@ -253,13 +254,13 @@ func (rs *REST) Get(ctx genericapirequest.Context, id string, options *metav1.Ge
return rs.registry.GetService(ctx, id, options) return rs.registry.GetService(ctx, id, options)
} }
func (rs *REST) List(ctx genericapirequest.Context, options *api.ListOptions) (runtime.Object, error) { func (rs *REST) List(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (runtime.Object, error) {
return rs.registry.ListServices(ctx, options) return rs.registry.ListServices(ctx, options)
} }
// Watch returns Services events via a watch.Interface. // Watch returns Services events via a watch.Interface.
// It implements rest.Watcher. // It implements rest.Watcher.
func (rs *REST) Watch(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (rs *REST) Watch(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return rs.registry.WatchServices(ctx, options) return rs.registry.WatchServices(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package serviceaccount package serviceaccount
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -26,8 +27,8 @@ import (
// Registry is an interface implemented by things that know how to store ServiceAccount objects. // Registry is an interface implemented by things that know how to store ServiceAccount objects.
type Registry interface { type Registry interface {
ListServiceAccounts(ctx genericapirequest.Context, options *api.ListOptions) (*api.ServiceAccountList, error) ListServiceAccounts(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ServiceAccountList, error)
WatchServiceAccounts(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchServiceAccounts(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
GetServiceAccount(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.ServiceAccount, error) GetServiceAccount(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*api.ServiceAccount, error)
CreateServiceAccount(ctx genericapirequest.Context, ServiceAccount *api.ServiceAccount) error CreateServiceAccount(ctx genericapirequest.Context, ServiceAccount *api.ServiceAccount) error
UpdateServiceAccount(ctx genericapirequest.Context, ServiceAccount *api.ServiceAccount) error UpdateServiceAccount(ctx genericapirequest.Context, ServiceAccount *api.ServiceAccount) error
@ -45,7 +46,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListServiceAccounts(ctx genericapirequest.Context, options *api.ListOptions) (*api.ServiceAccountList, error) { func (s *storage) ListServiceAccounts(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ServiceAccountList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -53,7 +54,7 @@ func (s *storage) ListServiceAccounts(ctx genericapirequest.Context, options *ap
return obj.(*api.ServiceAccountList), nil return obj.(*api.ServiceAccountList), nil
} }
func (s *storage) WatchServiceAccounts(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchServiceAccounts(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -19,6 +19,7 @@ package deployment
import ( import (
"fmt" "fmt"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
@ -28,7 +29,7 @@ import (
// Registry is an interface for things that know how to store Deployments. // Registry is an interface for things that know how to store Deployments.
type Registry interface { type Registry interface {
ListDeployments(ctx genericapirequest.Context, options *api.ListOptions) (*extensions.DeploymentList, error) ListDeployments(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*extensions.DeploymentList, error)
GetDeployment(ctx genericapirequest.Context, deploymentID string, options *metav1.GetOptions) (*extensions.Deployment, error) GetDeployment(ctx genericapirequest.Context, deploymentID string, options *metav1.GetOptions) (*extensions.Deployment, error)
CreateDeployment(ctx genericapirequest.Context, deployment *extensions.Deployment) (*extensions.Deployment, error) CreateDeployment(ctx genericapirequest.Context, deployment *extensions.Deployment) (*extensions.Deployment, error)
UpdateDeployment(ctx genericapirequest.Context, deployment *extensions.Deployment) (*extensions.Deployment, error) UpdateDeployment(ctx genericapirequest.Context, deployment *extensions.Deployment) (*extensions.Deployment, error)
@ -45,7 +46,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListDeployments(ctx genericapirequest.Context, options *api.ListOptions) (*extensions.DeploymentList, error) { func (s *storage) ListDeployments(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*extensions.DeploymentList, error) {
if options != nil && options.FieldSelector != nil && !options.FieldSelector.Empty() { if options != nil && options.FieldSelector != nil && !options.FieldSelector.Empty() {
return nil, fmt.Errorf("field selector not supported yet") return nil, fmt.Errorf("field selector not supported yet")
} }

View File

@ -21,6 +21,7 @@ package replicaset
import ( import (
"fmt" "fmt"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -31,8 +32,8 @@ import (
// Registry is an interface for things that know how to store ReplicaSets. // Registry is an interface for things that know how to store ReplicaSets.
type Registry interface { type Registry interface {
ListReplicaSets(ctx genericapirequest.Context, options *api.ListOptions) (*extensions.ReplicaSetList, error) ListReplicaSets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*extensions.ReplicaSetList, error)
WatchReplicaSets(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchReplicaSets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
GetReplicaSet(ctx genericapirequest.Context, replicaSetID string, options *metav1.GetOptions) (*extensions.ReplicaSet, error) GetReplicaSet(ctx genericapirequest.Context, replicaSetID string, options *metav1.GetOptions) (*extensions.ReplicaSet, error)
CreateReplicaSet(ctx genericapirequest.Context, replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error) CreateReplicaSet(ctx genericapirequest.Context, replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error)
UpdateReplicaSet(ctx genericapirequest.Context, replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error) UpdateReplicaSet(ctx genericapirequest.Context, replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error)
@ -50,7 +51,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListReplicaSets(ctx genericapirequest.Context, options *api.ListOptions) (*extensions.ReplicaSetList, error) { func (s *storage) ListReplicaSets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*extensions.ReplicaSetList, error) {
if options != nil && options.FieldSelector != nil && !options.FieldSelector.Empty() { if options != nil && options.FieldSelector != nil && !options.FieldSelector.Empty() {
return nil, fmt.Errorf("field selector not supported yet") return nil, fmt.Errorf("field selector not supported yet")
} }
@ -61,7 +62,7 @@ func (s *storage) ListReplicaSets(ctx genericapirequest.Context, options *api.Li
return obj.(*extensions.ReplicaSetList), err return obj.(*extensions.ReplicaSetList), err
} }
func (s *storage) WatchReplicaSets(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchReplicaSets(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package thirdpartyresourcedata package thirdpartyresourcedata
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -27,8 +28,8 @@ import (
// Registry is an interface implemented by things that know how to store ThirdPartyResourceData objects. // Registry is an interface implemented by things that know how to store ThirdPartyResourceData objects.
type Registry interface { type Registry interface {
ListThirdPartyResourceData(ctx genericapirequest.Context, options *api.ListOptions) (*extensions.ThirdPartyResourceDataList, error) ListThirdPartyResourceData(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*extensions.ThirdPartyResourceDataList, error)
WatchThirdPartyResourceData(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchThirdPartyResourceData(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
GetThirdPartyResourceData(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*extensions.ThirdPartyResourceData, error) GetThirdPartyResourceData(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*extensions.ThirdPartyResourceData, error)
CreateThirdPartyResourceData(ctx genericapirequest.Context, resource *extensions.ThirdPartyResourceData) (*extensions.ThirdPartyResourceData, error) CreateThirdPartyResourceData(ctx genericapirequest.Context, resource *extensions.ThirdPartyResourceData) (*extensions.ThirdPartyResourceData, error)
UpdateThirdPartyResourceData(ctx genericapirequest.Context, resource *extensions.ThirdPartyResourceData) (*extensions.ThirdPartyResourceData, error) UpdateThirdPartyResourceData(ctx genericapirequest.Context, resource *extensions.ThirdPartyResourceData) (*extensions.ThirdPartyResourceData, error)
@ -46,7 +47,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListThirdPartyResourceData(ctx genericapirequest.Context, options *api.ListOptions) (*extensions.ThirdPartyResourceDataList, error) { func (s *storage) ListThirdPartyResourceData(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*extensions.ThirdPartyResourceDataList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -54,7 +55,7 @@ func (s *storage) ListThirdPartyResourceData(ctx genericapirequest.Context, opti
return obj.(*extensions.ThirdPartyResourceDataList), nil return obj.(*extensions.ThirdPartyResourceDataList), nil
} }
func (s *storage) WatchThirdPartyResourceData(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchThirdPartyResourceData(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package clusterrole package clusterrole
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -27,12 +28,12 @@ import (
// Registry is an interface for things that know how to store ClusterRoles. // Registry is an interface for things that know how to store ClusterRoles.
type Registry interface { type Registry interface {
ListClusterRoles(ctx genericapirequest.Context, options *api.ListOptions) (*rbac.ClusterRoleList, error) ListClusterRoles(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*rbac.ClusterRoleList, error)
CreateClusterRole(ctx genericapirequest.Context, clusterRole *rbac.ClusterRole) error CreateClusterRole(ctx genericapirequest.Context, clusterRole *rbac.ClusterRole) error
UpdateClusterRole(ctx genericapirequest.Context, clusterRole *rbac.ClusterRole) error UpdateClusterRole(ctx genericapirequest.Context, clusterRole *rbac.ClusterRole) error
GetClusterRole(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*rbac.ClusterRole, error) GetClusterRole(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*rbac.ClusterRole, error)
DeleteClusterRole(ctx genericapirequest.Context, name string) error DeleteClusterRole(ctx genericapirequest.Context, name string) error
WatchClusterRoles(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchClusterRoles(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
} }
// storage puts strong typing around storage calls // storage puts strong typing around storage calls
@ -46,7 +47,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListClusterRoles(ctx genericapirequest.Context, options *api.ListOptions) (*rbac.ClusterRoleList, error) { func (s *storage) ListClusterRoles(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*rbac.ClusterRoleList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -65,7 +66,7 @@ func (s *storage) UpdateClusterRole(ctx genericapirequest.Context, clusterRole *
return err return err
} }
func (s *storage) WatchClusterRoles(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchClusterRoles(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package clusterrolebinding package clusterrolebinding
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -27,12 +28,12 @@ import (
// Registry is an interface for things that know how to store ClusterRoleBindings. // Registry is an interface for things that know how to store ClusterRoleBindings.
type Registry interface { type Registry interface {
ListClusterRoleBindings(ctx genericapirequest.Context, options *api.ListOptions) (*rbac.ClusterRoleBindingList, error) ListClusterRoleBindings(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*rbac.ClusterRoleBindingList, error)
CreateClusterRoleBinding(ctx genericapirequest.Context, clusterRoleBinding *rbac.ClusterRoleBinding) error CreateClusterRoleBinding(ctx genericapirequest.Context, clusterRoleBinding *rbac.ClusterRoleBinding) error
UpdateClusterRoleBinding(ctx genericapirequest.Context, clusterRoleBinding *rbac.ClusterRoleBinding) error UpdateClusterRoleBinding(ctx genericapirequest.Context, clusterRoleBinding *rbac.ClusterRoleBinding) error
GetClusterRoleBinding(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*rbac.ClusterRoleBinding, error) GetClusterRoleBinding(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*rbac.ClusterRoleBinding, error)
DeleteClusterRoleBinding(ctx genericapirequest.Context, name string) error DeleteClusterRoleBinding(ctx genericapirequest.Context, name string) error
WatchClusterRoleBindings(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchClusterRoleBindings(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
} }
// storage puts strong typing around storage calls // storage puts strong typing around storage calls
@ -46,7 +47,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListClusterRoleBindings(ctx genericapirequest.Context, options *api.ListOptions) (*rbac.ClusterRoleBindingList, error) { func (s *storage) ListClusterRoleBindings(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*rbac.ClusterRoleBindingList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -65,7 +66,7 @@ func (s *storage) UpdateClusterRoleBinding(ctx genericapirequest.Context, cluste
return err return err
} }
func (s *storage) WatchClusterRoleBindings(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchClusterRoleBindings(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }
@ -88,7 +89,7 @@ type AuthorizerAdapter struct {
} }
func (a AuthorizerAdapter) ListClusterRoleBindings() ([]*rbac.ClusterRoleBinding, error) { func (a AuthorizerAdapter) ListClusterRoleBindings() ([]*rbac.ClusterRoleBinding, error) {
list, err := a.Registry.ListClusterRoleBindings(genericapirequest.NewContext(), &api.ListOptions{}) list, err := a.Registry.ListClusterRoleBindings(genericapirequest.NewContext(), &metainternalversion.ListOptions{})
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package role package role
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -27,12 +28,12 @@ import (
// Registry is an interface for things that know how to store Roles. // Registry is an interface for things that know how to store Roles.
type Registry interface { type Registry interface {
ListRoles(ctx genericapirequest.Context, options *api.ListOptions) (*rbac.RoleList, error) ListRoles(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*rbac.RoleList, error)
CreateRole(ctx genericapirequest.Context, role *rbac.Role) error CreateRole(ctx genericapirequest.Context, role *rbac.Role) error
UpdateRole(ctx genericapirequest.Context, role *rbac.Role) error UpdateRole(ctx genericapirequest.Context, role *rbac.Role) error
GetRole(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*rbac.Role, error) GetRole(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*rbac.Role, error)
DeleteRole(ctx genericapirequest.Context, name string) error DeleteRole(ctx genericapirequest.Context, name string) error
WatchRoles(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchRoles(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
} }
// storage puts strong typing around storage calls // storage puts strong typing around storage calls
@ -46,7 +47,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListRoles(ctx genericapirequest.Context, options *api.ListOptions) (*rbac.RoleList, error) { func (s *storage) ListRoles(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*rbac.RoleList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -65,7 +66,7 @@ func (s *storage) UpdateRole(ctx genericapirequest.Context, role *rbac.Role) err
return err return err
} }
func (s *storage) WatchRoles(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchRoles(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }

View File

@ -17,6 +17,7 @@ limitations under the License.
package rolebinding package rolebinding
import ( import (
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -27,12 +28,12 @@ import (
// Registry is an interface for things that know how to store RoleBindings. // Registry is an interface for things that know how to store RoleBindings.
type Registry interface { type Registry interface {
ListRoleBindings(ctx genericapirequest.Context, options *api.ListOptions) (*rbac.RoleBindingList, error) ListRoleBindings(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*rbac.RoleBindingList, error)
CreateRoleBinding(ctx genericapirequest.Context, roleBinding *rbac.RoleBinding) error CreateRoleBinding(ctx genericapirequest.Context, roleBinding *rbac.RoleBinding) error
UpdateRoleBinding(ctx genericapirequest.Context, roleBinding *rbac.RoleBinding) error UpdateRoleBinding(ctx genericapirequest.Context, roleBinding *rbac.RoleBinding) error
GetRoleBinding(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*rbac.RoleBinding, error) GetRoleBinding(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*rbac.RoleBinding, error)
DeleteRoleBinding(ctx genericapirequest.Context, name string) error DeleteRoleBinding(ctx genericapirequest.Context, name string) error
WatchRoleBindings(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) WatchRoleBindings(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
} }
// storage puts strong typing around storage calls // storage puts strong typing around storage calls
@ -46,7 +47,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
return &storage{s} return &storage{s}
} }
func (s *storage) ListRoleBindings(ctx genericapirequest.Context, options *api.ListOptions) (*rbac.RoleBindingList, error) { func (s *storage) ListRoleBindings(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*rbac.RoleBindingList, error) {
obj, err := s.List(ctx, options) obj, err := s.List(ctx, options)
if err != nil { if err != nil {
return nil, err return nil, err
@ -66,7 +67,7 @@ func (s *storage) UpdateRoleBinding(ctx genericapirequest.Context, roleBinding *
return err return err
} }
func (s *storage) WatchRoleBindings(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (s *storage) WatchRoleBindings(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return s.Watch(ctx, options) return s.Watch(ctx, options)
} }
@ -89,7 +90,7 @@ type AuthorizerAdapter struct {
} }
func (a AuthorizerAdapter) ListRoleBindings(namespace string) ([]*rbac.RoleBinding, error) { func (a AuthorizerAdapter) ListRoleBindings(namespace string) ([]*rbac.RoleBinding, error) {
list, err := a.Registry.ListRoleBindings(genericapirequest.WithNamespace(genericapirequest.NewContext(), namespace), &api.ListOptions{}) list, err := a.Registry.ListRoleBindings(genericapirequest.WithNamespace(genericapirequest.NewContext(), namespace), &metainternalversion.ListOptions{})
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -21,6 +21,7 @@ import (
"sync" "sync"
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -36,7 +37,7 @@ type EndpointRegistry struct {
lock sync.Mutex lock sync.Mutex
} }
func (e *EndpointRegistry) ListEndpoints(ctx genericapirequest.Context, options *api.ListOptions) (*api.EndpointsList, error) { func (e *EndpointRegistry) ListEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.EndpointsList, error) {
// TODO: support namespaces in this mock // TODO: support namespaces in this mock
e.lock.Lock() e.lock.Lock()
defer e.lock.Unlock() defer e.lock.Unlock()
@ -61,7 +62,7 @@ func (e *EndpointRegistry) GetEndpoints(ctx genericapirequest.Context, name stri
return nil, errors.NewNotFound(api.Resource("endpoints"), name) return nil, errors.NewNotFound(api.Resource("endpoints"), name)
} }
func (e *EndpointRegistry) WatchEndpoints(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (e *EndpointRegistry) WatchEndpoints(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return nil, fmt.Errorf("unimplemented!") return nil, fmt.Errorf("unimplemented!")
} }

View File

@ -20,6 +20,7 @@ import (
"sync" "sync"
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -59,7 +60,7 @@ func (r *NodeRegistry) SetError(err error) {
r.Err = err r.Err = err
} }
func (r *NodeRegistry) ListNodes(ctx genericapirequest.Context, options *api.ListOptions) (*api.NodeList, error) { func (r *NodeRegistry) ListNodes(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.NodeList, error) {
r.Lock() r.Lock()
defer r.Unlock() defer r.Unlock()
return &r.Nodes, r.Err return &r.Nodes, r.Err
@ -112,6 +113,6 @@ func (r *NodeRegistry) DeleteNode(ctx genericapirequest.Context, nodeID string)
return r.Err return r.Err
} }
func (r *NodeRegistry) WatchNodes(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (r *NodeRegistry) WatchNodes(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
return nil, r.Err return nil, r.Err
} }

View File

@ -19,6 +19,7 @@ package registrytest
import ( import (
"sync" "sync"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
@ -47,7 +48,7 @@ func (r *ServiceRegistry) SetError(err error) {
r.Err = err r.Err = err
} }
func (r *ServiceRegistry) ListServices(ctx genericapirequest.Context, options *api.ListOptions) (*api.ServiceList, error) { func (r *ServiceRegistry) ListServices(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*api.ServiceList, error) {
r.mu.Lock() r.mu.Lock()
defer r.mu.Unlock() defer r.mu.Unlock()
@ -113,7 +114,7 @@ func (r *ServiceRegistry) UpdateService(ctx genericapirequest.Context, svc *api.
return svc, r.Err return svc, r.Err
} }
func (r *ServiceRegistry) WatchServices(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) { func (r *ServiceRegistry) WatchServices(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
r.mu.Lock() r.mu.Lock()
defer r.mu.Unlock() defer r.mu.Unlock()