Skip to content

Commit 1ce3eee

Browse files
Merge pull request #18478 from juanvallejo/backport-origin-pr-18219-limit-all
Automatic merge from submit-queue. Backport origin pr 18219 limit all Picks kubernetes/kubernetes#49624 Picks #18219 Depends on #18476 Addresses #18473 (comment) cc @deads2k
2 parents 284b8b7 + 23dc949 commit 1ce3eee

File tree

14 files changed

+111
-23
lines changed

14 files changed

+111
-23
lines changed

Diff for: pkg/apps/registry/deployconfig/etcd/etcd.go

+9
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,12 @@ func (r *StatusREST) Get(ctx apirequest.Context, name string, options *metav1.Ge
144144
func (r *StatusREST) Update(ctx apirequest.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
145145
return r.store.Update(ctx, name, objInfo)
146146
}
147+
148+
// LegacyREST allows us to wrap and alter some behavior
149+
type LegacyREST struct {
150+
*REST
151+
}
152+
153+
func (r *LegacyREST) Categories() []string {
154+
return []string{}
155+
}

Diff for: pkg/build/registry/build/etcd/etcd.go

+9
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,12 @@ func (r *DetailsREST) New() runtime.Object {
6868
func (r *DetailsREST) Update(ctx apirequest.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
6969
return r.store.Update(ctx, name, objInfo)
7070
}
71+
72+
// LegacyREST allows us to wrap and alter some behavior
73+
type LegacyREST struct {
74+
*REST
75+
}
76+
77+
func (r *LegacyREST) Categories() []string {
78+
return []string{}
79+
}

Diff for: pkg/build/registry/buildconfig/etcd/etcd.go

+9
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,12 @@ func NewREST(optsGetter restoptions.Getter) (*REST, error) {
5050

5151
return &REST{store}, nil
5252
}
53+
54+
// LegacyREST allows us to wrap and alter some behavior
55+
type LegacyREST struct {
56+
*REST
57+
}
58+
59+
func (r *LegacyREST) Categories() []string {
60+
return []string{}
61+
}

Diff for: pkg/cmd/server/origin/legacy.go

+20-13
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import (
77

88
"github.com/openshift/origin/pkg/apps/registry/deployconfig"
99
deploymentconfigetcd "github.com/openshift/origin/pkg/apps/registry/deployconfig/etcd"
10+
buildetcd "github.com/openshift/origin/pkg/build/registry/build/etcd"
1011
buildconfig "github.com/openshift/origin/pkg/build/registry/buildconfig"
1112
buildconfigetcd "github.com/openshift/origin/pkg/build/registry/buildconfig/etcd"
13+
imagestreametcd "github.com/openshift/origin/pkg/image/registry/imagestream/etcd"
1214
routeregistry "github.com/openshift/origin/pkg/route/registry/route"
1315
routeetcd "github.com/openshift/origin/pkg/route/registry/route/etcd"
1416
)
@@ -197,24 +199,29 @@ func LegacyStorage(storage map[schema.GroupVersion]map[string]rest.Storage) map[
197199
// Kube only did this for a select few resources which were controller managed and established links
198200
// via a workload controller. In openshift, these will all conform to registry.Store so we
199201
// can actually wrap the "normal" storage here.
200-
switch resource {
201-
case "buildConfigs":
202-
restStorage := s.(*buildconfigetcd.REST)
203-
store := *restStorage.Store
202+
switch storage := s.(type) {
203+
case *buildetcd.REST:
204+
legacyStorage[resource] = &buildetcd.LegacyREST{REST: storage}
205+
206+
case *buildconfigetcd.REST:
207+
store := *storage.Store
204208
store.DeleteStrategy = buildconfig.LegacyStrategy
205209
store.CreateStrategy = buildconfig.LegacyStrategy
206-
legacyStorage[resource] = &buildconfigetcd.REST{Store: &store}
207-
case "deploymentConfigs":
208-
restStorage := s.(*deploymentconfigetcd.REST)
209-
store := *restStorage.Store
210+
legacyStorage[resource] = &buildconfigetcd.LegacyREST{REST: &buildconfigetcd.REST{Store: &store}}
211+
212+
case *deploymentconfigetcd.REST:
213+
store := *storage.Store
210214
store.CreateStrategy = deployconfig.LegacyStrategy
211215
store.DeleteStrategy = deployconfig.LegacyStrategy
212-
legacyStorage[resource] = &deploymentconfigetcd.REST{Store: &store}
213-
case "routes":
214-
restStorage := s.(*routeetcd.REST)
215-
store := *restStorage.Store
216+
legacyStorage[resource] = &deploymentconfigetcd.LegacyREST{REST: &deploymentconfigetcd.REST{Store: &store}}
217+
218+
case *imagestreametcd.REST:
219+
legacyStorage[resource] = &imagestreametcd.LegacyREST{REST: storage}
220+
221+
case *routeetcd.REST:
222+
store := *storage.Store
216223
store.Decorator = routeregistry.DecorateLegacyRouteWithEmptyDestinationCACertificates
217-
legacyStorage[resource] = &routeetcd.REST{Store: &store}
224+
legacyStorage[resource] = &routeetcd.LegacyREST{REST: &routeetcd.REST{Store: &store}}
218225

219226
default:
220227
legacyStorage[resource] = s

Diff for: pkg/image/registry/imagestream/etcd/etcd.go

+9
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,12 @@ func (r *InternalREST) Create(ctx apirequest.Context, obj runtime.Object, _ bool
127127
func (r *InternalREST) Update(ctx apirequest.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
128128
return r.store.Update(ctx, name, objInfo)
129129
}
130+
131+
// LegacyREST allows us to wrap and alter some behavior
132+
type LegacyREST struct {
133+
*REST
134+
}
135+
136+
func (r *LegacyREST) Categories() []string {
137+
return []string{}
138+
}

Diff for: pkg/route/registry/route/etcd/etcd.go

+9
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@ func (r *StatusREST) Get(ctx apirequest.Context, name string, options *metav1.Ge
8080
func (r *StatusREST) Update(ctx apirequest.Context, name string, objInfo kapirest.UpdatedObjectInfo) (runtime.Object, bool, error) {
8181
return r.store.Update(ctx, name, objInfo)
8282
}
83+
84+
// LegacyREST allows us to wrap and alter some behavior
85+
type LegacyREST struct {
86+
*REST
87+
}
88+
89+
func (r *LegacyREST) Categories() []string {
90+
return []string{}
91+
}

Diff for: pkg/security/registry/securitycontextconstraints/etcd/etcd.go

+9
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,12 @@ func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
4747
}
4848
return &REST{store}
4949
}
50+
51+
// LegacyREST allows us to wrap and alter some behavior
52+
type LegacyREST struct {
53+
*REST
54+
}
55+
56+
func (r *LegacyREST) Categories() []string {
57+
return []string{}
58+
}

Diff for: vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/factory_test.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/k8s.io/kubernetes/pkg/kubectl/resource/categories.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/k8s.io/kubernetes/pkg/kubectl/resource/categories_test.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/k8s.io/kubernetes/pkg/registry/extensions/daemonset/storage/storage.go

+14-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/k8s.io/kubernetes/pkg/registry/extensions/deployment/storage/storage.go

+8-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/k8s.io/kubernetes/pkg/registry/extensions/replicaset/storage/storage.go

+8-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/k8s.io/kubernetes/pkg/registry/extensions/rest/storage_extensions.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)