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 8cd497ecaab..a6607d66c15 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 ab10ac2ec63..c5df8cb0c28 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 fd2846ebdbc..e09f8812047 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 60fe1daf1ff..614455924c2 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 85e6261e9d7..185d4331c29 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 71fac1e74cc..726fb63ab1b 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 894304df9a0..cfecfd43747 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 bc707b7f111..c37af18eab7 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 1b53f4ddd1d..53d92d827b1 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 5621f3878b0..f724bf88750 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 dbda1a97799..1d9a92a83f1 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 cdbe23ec713..8e9939a3df1 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 2e172fd2435..8fa3524fb6a 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 8d5aaeb2834..463dd689e7d 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 1e13c63e00d..ea343ae29cd 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 7cab22bde2e..ff0cf073958 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 fed31753e92..1ebbc429292 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)