Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 5a9e5be

Browse files
author
Chao Xu
committed
expose GET and PATCH for status subresource
1 parent 0f30036 commit 5a9e5be

File tree

17 files changed

+85
-0
lines changed

17 files changed

+85
-0
lines changed

pkg/registry/controller/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ func (r *StatusREST) New() runtime.Object {
116116
return &api.ReplicationController{}
117117
}
118118

119+
// Get retrieves the object from the storage. It is required to support Patch.
120+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
121+
return r.store.Get(ctx, name)
122+
}
123+
119124
// Update alters the status subset of an object.
120125
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
121126
return r.store.Update(ctx, name, objInfo)

pkg/registry/daemonset/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ func (r *StatusREST) New() runtime.Object {
9292
return &extensions.DaemonSet{}
9393
}
9494

95+
// Get retrieves the object from the storage. It is required to support Patch.
96+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
97+
return r.store.Get(ctx, name)
98+
}
99+
95100
// Update alters the status subset of an object.
96101
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
97102
return r.store.Update(ctx, name, objInfo)

pkg/registry/deployment/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ func (r *StatusREST) New() runtime.Object {
115115
return &extensions.Deployment{}
116116
}
117117

118+
// Get retrieves the object from the storage. It is required to support Patch.
119+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
120+
return r.store.Get(ctx, name)
121+
}
122+
118123
// Update alters the status subset of an object.
119124
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
120125
return r.store.Update(ctx, name, objInfo)

pkg/registry/horizontalpodautoscaler/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ func (r *StatusREST) New() runtime.Object {
8989
return &autoscaling.HorizontalPodAutoscaler{}
9090
}
9191

92+
// Get retrieves the object from the storage. It is required to support Patch.
93+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
94+
return r.store.Get(ctx, name)
95+
}
96+
9297
// Update alters the status subset of an object.
9398
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
9499
return r.store.Update(ctx, name, objInfo)

pkg/registry/ingress/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ func (r *StatusREST) New() runtime.Object {
9191
return &extensions.Ingress{}
9292
}
9393

94+
// Get retrieves the object from the storage. It is required to support Patch.
95+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
96+
return r.store.Get(ctx, name)
97+
}
98+
9499
// Update alters the status subset of an object.
95100
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
96101
return r.store.Update(ctx, name, objInfo)

pkg/registry/job/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ func (r *StatusREST) New() runtime.Object {
9393
return &batch.Job{}
9494
}
9595

96+
// Get retrieves the object from the storage. It is required to support Patch.
97+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
98+
return r.store.Get(ctx, name)
99+
}
100+
96101
// Update alters the status subset of an object.
97102
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
98103
return r.store.Update(ctx, name, objInfo)

pkg/registry/namespace/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ func (r *StatusREST) New() runtime.Object {
176176
return r.store.New()
177177
}
178178

179+
// Get retrieves the object from the storage. It is required to support Patch.
180+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
181+
return r.store.Get(ctx, name)
182+
}
183+
179184
// Update alters the status subset of an object.
180185
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
181186
return r.store.Update(ctx, name, objInfo)

pkg/registry/node/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ func (r *StatusREST) New() runtime.Object {
5454
return &api.Node{}
5555
}
5656

57+
// Get retrieves the object from the storage. It is required to support Patch.
58+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
59+
return r.store.Get(ctx, name)
60+
}
61+
5762
// Update alters the status subset of an object.
5863
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
5964
return r.store.Update(ctx, name, objInfo)

pkg/registry/persistentvolume/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ func (r *StatusREST) New() runtime.Object {
8181
return &api.PersistentVolume{}
8282
}
8383

84+
// Get retrieves the object from the storage. It is required to support Patch.
85+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
86+
return r.store.Get(ctx, name)
87+
}
88+
8489
// Update alters the status subset of an object.
8590
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
8691
return r.store.Update(ctx, name, objInfo)

pkg/registry/persistentvolumeclaim/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ func (r *StatusREST) New() runtime.Object {
8181
return &api.PersistentVolumeClaim{}
8282
}
8383

84+
// Get retrieves the object from the storage. It is required to support Patch.
85+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
86+
return r.store.Get(ctx, name)
87+
}
88+
8489
// Update alters the status subset of an object.
8590
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
8691
return r.store.Update(ctx, name, objInfo)

pkg/registry/petset/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ func (r *StatusREST) New() runtime.Object {
9191
return &appsapi.PetSet{}
9292
}
9393

94+
// Get retrieves the object from the storage. It is required to support Patch.
95+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
96+
return r.store.Get(ctx, name)
97+
}
98+
9499
// Update alters the status subset of an object.
95100
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
96101
return r.store.Update(ctx, name, objInfo)

pkg/registry/pod/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ func (r *StatusREST) New() runtime.Object {
198198
return &api.Pod{}
199199
}
200200

201+
// Get retrieves the object from the storage. It is required to support Patch.
202+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
203+
return r.store.Get(ctx, name)
204+
}
205+
201206
// Update alters the status subset of an object.
202207
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
203208
return r.store.Update(ctx, name, objInfo)

pkg/registry/poddisruptionbudget/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ func (r *StatusREST) New() runtime.Object {
9191
return &policyapi.PodDisruptionBudget{}
9292
}
9393

94+
// Get retrieves the object from the storage. It is required to support Patch.
95+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
96+
return r.store.Get(ctx, name)
97+
}
98+
9499
// Update alters the status subset of an object.
95100
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
96101
return r.store.Update(ctx, name, objInfo)

pkg/registry/replicaset/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ func (r *StatusREST) New() runtime.Object {
115115
return &extensions.ReplicaSet{}
116116
}
117117

118+
// Get retrieves the object from the storage. It is required to support Patch.
119+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
120+
return r.store.Get(ctx, name)
121+
}
122+
118123
// Update alters the status subset of an object.
119124
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
120125
return r.store.Update(ctx, name, objInfo)

pkg/registry/resourcequota/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ func (r *StatusREST) New() runtime.Object {
8181
return &api.ResourceQuota{}
8282
}
8383

84+
// Get retrieves the object from the storage. It is required to support Patch.
85+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
86+
return r.store.Get(ctx, name)
87+
}
88+
8489
// Update alters the status subset of an object.
8590
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
8691
return r.store.Update(ctx, name, objInfo)

pkg/registry/scheduledjob/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ func (r *StatusREST) New() runtime.Object {
9292
return &batch.ScheduledJob{}
9393
}
9494

95+
// Get retrieves the object from the storage. It is required to support Patch.
96+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
97+
return r.store.Get(ctx, name)
98+
}
99+
95100
// Update alters the status subset of an object.
96101
func (r *StatusREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) {
97102
return r.store.Update(ctx, obj)

pkg/registry/service/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ func (r *StatusREST) New() runtime.Object {
7979
return &api.Service{}
8080
}
8181

82+
// Get retrieves the object from the storage. It is required to support Patch.
83+
func (r *StatusREST) Get(ctx api.Context, name string) (runtime.Object, error) {
84+
return r.store.Get(ctx, name)
85+
}
86+
8287
// Update alters the status subset of an object.
8388
func (r *StatusREST) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
8489
return r.store.Update(ctx, name, objInfo)

0 commit comments

Comments
 (0)