From 5a9e5be4c6f642b9dd32f4b0d6a7b292b2b22f47 Mon Sep 17 00:00:00 2001 From: Chao Xu Date: Thu, 26 May 2016 14:33:46 -0700 Subject: [PATCH] expose GET and PATCH for status subresource --- pkg/registry/controller/etcd/etcd.go | 5 +++++ pkg/registry/daemonset/etcd/etcd.go | 5 +++++ pkg/registry/deployment/etcd/etcd.go | 5 +++++ pkg/registry/horizontalpodautoscaler/etcd/etcd.go | 5 +++++ pkg/registry/ingress/etcd/etcd.go | 5 +++++ pkg/registry/job/etcd/etcd.go | 5 +++++ pkg/registry/namespace/etcd/etcd.go | 5 +++++ pkg/registry/node/etcd/etcd.go | 5 +++++ pkg/registry/persistentvolume/etcd/etcd.go | 5 +++++ pkg/registry/persistentvolumeclaim/etcd/etcd.go | 5 +++++ pkg/registry/petset/etcd/etcd.go | 5 +++++ pkg/registry/pod/etcd/etcd.go | 5 +++++ pkg/registry/poddisruptionbudget/etcd/etcd.go | 5 +++++ pkg/registry/replicaset/etcd/etcd.go | 5 +++++ pkg/registry/resourcequota/etcd/etcd.go | 5 +++++ pkg/registry/scheduledjob/etcd/etcd.go | 5 +++++ pkg/registry/service/etcd/etcd.go | 5 +++++ 17 files changed, 85 insertions(+) diff --git a/pkg/registry/controller/etcd/etcd.go b/pkg/registry/controller/etcd/etcd.go index 8cd497ecaa..a6607d66c1 100644 --- a/pkg/registry/controller/etcd/etcd.go +++ b/pkg/registry/controller/etcd/etcd.go @@ -116,6 +116,11 @@ func (r *StatusREST) New() runtime.Object { return &api.ReplicationController{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/daemonset/etcd/etcd.go b/pkg/registry/daemonset/etcd/etcd.go index ab10ac2ec6..c5df8cb0c2 100644 --- a/pkg/registry/daemonset/etcd/etcd.go +++ b/pkg/registry/daemonset/etcd/etcd.go @@ -92,6 +92,11 @@ func (r *StatusREST) New() runtime.Object { return &extensions.DaemonSet{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/deployment/etcd/etcd.go b/pkg/registry/deployment/etcd/etcd.go index fd2846ebdb..e09f881204 100644 --- a/pkg/registry/deployment/etcd/etcd.go +++ b/pkg/registry/deployment/etcd/etcd.go @@ -115,6 +115,11 @@ func (r *StatusREST) New() runtime.Object { return &extensions.Deployment{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/horizontalpodautoscaler/etcd/etcd.go b/pkg/registry/horizontalpodautoscaler/etcd/etcd.go index 60fe1daf1f..614455924c 100644 --- a/pkg/registry/horizontalpodautoscaler/etcd/etcd.go +++ b/pkg/registry/horizontalpodautoscaler/etcd/etcd.go @@ -89,6 +89,11 @@ func (r *StatusREST) New() runtime.Object { return &autoscaling.HorizontalPodAutoscaler{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/ingress/etcd/etcd.go b/pkg/registry/ingress/etcd/etcd.go index 85e6261e9d..185d4331c2 100644 --- a/pkg/registry/ingress/etcd/etcd.go +++ b/pkg/registry/ingress/etcd/etcd.go @@ -91,6 +91,11 @@ func (r *StatusREST) New() runtime.Object { return &extensions.Ingress{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/job/etcd/etcd.go b/pkg/registry/job/etcd/etcd.go index 71fac1e74c..726fb63ab1 100644 --- a/pkg/registry/job/etcd/etcd.go +++ b/pkg/registry/job/etcd/etcd.go @@ -93,6 +93,11 @@ func (r *StatusREST) New() runtime.Object { return &batch.Job{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/namespace/etcd/etcd.go b/pkg/registry/namespace/etcd/etcd.go index 894304df9a..cfecfd4374 100644 --- a/pkg/registry/namespace/etcd/etcd.go +++ b/pkg/registry/namespace/etcd/etcd.go @@ -176,6 +176,11 @@ func (r *StatusREST) New() runtime.Object { return r.store.New() } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/node/etcd/etcd.go b/pkg/registry/node/etcd/etcd.go index bc707b7f11..c37af18eab 100644 --- a/pkg/registry/node/etcd/etcd.go +++ b/pkg/registry/node/etcd/etcd.go @@ -54,6 +54,11 @@ func (r *StatusREST) New() runtime.Object { return &api.Node{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/persistentvolume/etcd/etcd.go b/pkg/registry/persistentvolume/etcd/etcd.go index 1b53f4ddd1..53d92d827b 100644 --- a/pkg/registry/persistentvolume/etcd/etcd.go +++ b/pkg/registry/persistentvolume/etcd/etcd.go @@ -81,6 +81,11 @@ func (r *StatusREST) New() runtime.Object { return &api.PersistentVolume{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/persistentvolumeclaim/etcd/etcd.go b/pkg/registry/persistentvolumeclaim/etcd/etcd.go index 5621f3878b..f724bf8875 100644 --- a/pkg/registry/persistentvolumeclaim/etcd/etcd.go +++ b/pkg/registry/persistentvolumeclaim/etcd/etcd.go @@ -81,6 +81,11 @@ func (r *StatusREST) New() runtime.Object { return &api.PersistentVolumeClaim{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/petset/etcd/etcd.go b/pkg/registry/petset/etcd/etcd.go index dbda1a9779..1d9a92a83f 100644 --- a/pkg/registry/petset/etcd/etcd.go +++ b/pkg/registry/petset/etcd/etcd.go @@ -91,6 +91,11 @@ func (r *StatusREST) New() runtime.Object { return &appsapi.PetSet{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/pod/etcd/etcd.go b/pkg/registry/pod/etcd/etcd.go index cdbe23ec71..8e9939a3df 100644 --- a/pkg/registry/pod/etcd/etcd.go +++ b/pkg/registry/pod/etcd/etcd.go @@ -198,6 +198,11 @@ func (r *StatusREST) New() runtime.Object { return &api.Pod{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/poddisruptionbudget/etcd/etcd.go b/pkg/registry/poddisruptionbudget/etcd/etcd.go index 2e172fd243..8fa3524fb6 100644 --- a/pkg/registry/poddisruptionbudget/etcd/etcd.go +++ b/pkg/registry/poddisruptionbudget/etcd/etcd.go @@ -91,6 +91,11 @@ func (r *StatusREST) New() runtime.Object { return &policyapi.PodDisruptionBudget{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/replicaset/etcd/etcd.go b/pkg/registry/replicaset/etcd/etcd.go index 8d5aaeb283..463dd689e7 100644 --- a/pkg/registry/replicaset/etcd/etcd.go +++ b/pkg/registry/replicaset/etcd/etcd.go @@ -115,6 +115,11 @@ func (r *StatusREST) New() runtime.Object { return &extensions.ReplicaSet{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/resourcequota/etcd/etcd.go b/pkg/registry/resourcequota/etcd/etcd.go index 1e13c63e00..ea343ae29c 100644 --- a/pkg/registry/resourcequota/etcd/etcd.go +++ b/pkg/registry/resourcequota/etcd/etcd.go @@ -81,6 +81,11 @@ func (r *StatusREST) New() runtime.Object { return &api.ResourceQuota{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo) diff --git a/pkg/registry/scheduledjob/etcd/etcd.go b/pkg/registry/scheduledjob/etcd/etcd.go index 7cab22bde2..ff0cf07395 100644 --- a/pkg/registry/scheduledjob/etcd/etcd.go +++ b/pkg/registry/scheduledjob/etcd/etcd.go @@ -92,6 +92,11 @@ func (r *StatusREST) New() runtime.Object { return &batch.ScheduledJob{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) { return r.store.Update(ctx, obj) diff --git a/pkg/registry/service/etcd/etcd.go b/pkg/registry/service/etcd/etcd.go index fed31753e9..1ebbc42929 100644 --- a/pkg/registry/service/etcd/etcd.go +++ b/pkg/registry/service/etcd/etcd.go @@ -79,6 +79,11 @@ func (r *StatusREST) New() runtime.Object { return &api.Service{} } +// Get retrieves the object from the storage. It is required to support Patch. +func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) { + return r.store.Get(ctx, name) +} + // Update alters the status subset of an object. func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { return r.store.Update(ctx, name, objInfo)