Skip to content

Commit d141711

Browse files
mfojtiksoltysh
authored andcommitted
interesting: fix filterByScheme for apps in projectstatus test
1 parent d96c357 commit d141711

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/oc/cli/describe/projectstatus_test.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121

2222
oapi "github.com/openshift/origin/pkg/api"
2323
osgraph "github.com/openshift/origin/pkg/api/graph"
24+
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
2425
appsfakeclient "github.com/openshift/origin/pkg/apps/generated/internalclientset/fake"
25-
appsclientscheme "github.com/openshift/origin/pkg/apps/generated/internalclientset/scheme"
2626
buildfakeclient "github.com/openshift/origin/pkg/build/generated/internalclientset/fake"
2727
buildclientscheme "github.com/openshift/origin/pkg/build/generated/internalclientset/scheme"
2828
imagefakeclient "github.com/openshift/origin/pkg/image/generated/internalclientset/fake"
@@ -438,11 +438,17 @@ func TestProjectStatus(t *testing.T) {
438438
objs = append(objs, o)
439439
}
440440

441+
// We need an empty scheme for apps to only filter objects included in
442+
// apps.openshift.io scheme. The appsclientscheme has kube types registered
443+
// which will break the filterByScheme.
444+
appsScheme := runtime.NewScheme()
445+
appsapi.AddToScheme(appsScheme)
446+
441447
kc := kubefakeclient.NewSimpleClientset(filterByScheme(kubeclientscheme.Scheme, objs...)...)
442448
projectClient := projectfakeclient.NewSimpleClientset(filterByScheme(projectclientscheme.Scheme, objs...)...)
443449
buildClient := buildfakeclient.NewSimpleClientset(filterByScheme(buildclientscheme.Scheme, objs...)...)
444450
imageClient := imagefakeclient.NewSimpleClientset(filterByScheme(imageclientscheme.Scheme, objs...)...)
445-
appsClient := appsfakeclient.NewSimpleClientset(filterByScheme(appsclientscheme.Scheme, objs...)...)
451+
appsClient := appsfakeclient.NewSimpleClientset(filterByScheme(appsScheme, objs...)...)
446452
routeClient := routefakeclient.NewSimpleClientset(filterByScheme(routeclientscheme.Scheme, objs...)...)
447453

448454
d := ProjectStatusDescriber{

0 commit comments

Comments
 (0)