remove storage dependency on api
This commit is contained in:
@@ -32,6 +32,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work with ConfigMap objects.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.ConfigMap{} },
|
||||
NewListFunc: func() runtime.Object { return &api.ConfigMapList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -31,6 +31,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against endpoints.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.Endpoints{} },
|
||||
NewListFunc: func() runtime.Object { return &api.EndpointsList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -41,6 +41,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter, ttl uint64) *REST {
|
||||
opts.Decorator = generic.UndecoratedStorage // TODO use watchCacheSize=-1 to signal UndecoratedStorage
|
||||
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.Event{} },
|
||||
NewListFunc: func() runtime.Object { return &api.EventList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -31,6 +31,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against horizontal pod autoscalers.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.LimitRange{} },
|
||||
NewListFunc: func() runtime.Object { return &api.LimitRangeList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -51,6 +51,7 @@ type FinalizeREST struct {
|
||||
// NewREST returns a RESTStorage object that will work against namespaces.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, *FinalizeREST) {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.Namespace{} },
|
||||
NewListFunc: func() runtime.Object { return &api.NamespaceList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -71,6 +71,7 @@ func (r *StatusREST) Update(ctx genericapirequest.Context, name string, objInfo
|
||||
// NewStorage returns a NodeStorage object that will work against nodes.
|
||||
func NewStorage(optsGetter generic.RESTOptionsGetter, kubeletClientConfig client.KubeletClientConfig, proxyTransport http.RoundTripper) (*NodeStorage, error) {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.Node{} },
|
||||
NewListFunc: func() runtime.Object { return &api.NodeList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -34,6 +34,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against persistent volumes.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.PersistentVolume{} },
|
||||
NewListFunc: func() runtime.Object { return &api.PersistentVolumeList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -34,6 +34,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against persistent volume claims.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.PersistentVolumeClaim{} },
|
||||
NewListFunc: func() runtime.Object { return &api.PersistentVolumeClaimList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -60,6 +60,7 @@ type REST struct {
|
||||
// NewStorage returns a RESTStorage object that will work against pods.
|
||||
func NewStorage(optsGetter generic.RESTOptionsGetter, k client.ConnectionInfoGetter, proxyTransport http.RoundTripper, podDisruptionBudgetClient policyclient.PodDisruptionBudgetsGetter) PodStorage {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.Pod{} },
|
||||
NewListFunc: func() runtime.Object { return &api.PodList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -31,6 +31,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against pod templates.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.PodTemplate{} },
|
||||
NewListFunc: func() runtime.Object { return &api.PodTemplateList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -60,6 +60,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against replication controllers.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.ReplicationController{} },
|
||||
NewListFunc: func() runtime.Object { return &api.ReplicationControllerList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -34,6 +34,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against resource quotas.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.ResourceQuota{} },
|
||||
NewListFunc: func() runtime.Object { return &api.ResourceQuotaList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -31,6 +31,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against secrets.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.Secret{} },
|
||||
NewListFunc: func() runtime.Object { return &api.SecretList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -34,6 +34,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against services.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.Service{} },
|
||||
NewListFunc: func() runtime.Object { return &api.ServiceList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
@@ -31,6 +31,7 @@ type REST struct {
|
||||
// NewREST returns a RESTStorage object that will work against service accounts.
|
||||
func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
|
||||
store := &genericregistry.Store{
|
||||
Copier: api.Scheme,
|
||||
NewFunc: func() runtime.Object { return &api.ServiceAccount{} },
|
||||
NewListFunc: func() runtime.Object { return &api.ServiceAccountList{} },
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
|
Reference in New Issue
Block a user