From 8dbb07b094855d80f693164a07d83878a6fbeb85 Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Wed, 24 Jun 2020 05:44:54 +0530 Subject: [PATCH] Revert "Remove unwanted schemes" This reverts commit 445cf2eb8c498b015eab2c867a52b00420f8037b. --- cmd/manager/main.go | 2 +- deploy/role.yaml | 10 ++++++++++ pkg/apis/apis.go | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 1d78126d..518cb191 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -225,10 +225,10 @@ func filterGKVsFromAddToScheme(gvks []schema.GroupVersionKind) []schema.GroupVer {Kind: "Pod", Version: matchAnyValue}, {Kind: "ConfigMap", Version: matchAnyValue}, {Kind: "Service", Version: matchAnyValue}, + {Group: "apps", Kind: "Deployment", Version: matchAnyValue}, // Openshift Resources {Group: "route.openshift.io", Kind: "Route", Version: matchAnyValue}, {Group: "image.openshift.io", Kind: "ImageStream", Version: matchAnyValue}, - {Group: "apps.openshift.io", Kind: "DeploymentConfig", Version: matchAnyValue}, // Custom Resources {Group: "jenkins.io", Kind: "Jenkins", Version: matchAnyValue}, {Group: "jenkins.io", Kind: "JenkinsImage", Version: matchAnyValue}, diff --git a/deploy/role.yaml b/deploy/role.yaml index c4e0059b..a2653abc 100644 --- a/deploy/role.yaml +++ b/deploy/role.yaml @@ -88,6 +88,16 @@ rules: - get - list - watch + - apiGroups: + - "route.openshift.io" + resources: + - routes + verbs: + - get + - list + - watch + - create + - update - apiGroups: - "image.openshift.io" resources: diff --git a/pkg/apis/apis.go b/pkg/apis/apis.go index 1fb7d62f..e2d7b6af 100644 --- a/pkg/apis/apis.go +++ b/pkg/apis/apis.go @@ -2,6 +2,8 @@ package apis import ( "github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2" + routev1 "github.com/openshift/api/route/v1" + appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -17,4 +19,6 @@ func AddToScheme(s *runtime.Scheme) error { func init() { // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back AddToSchemes = append(AddToSchemes, v1alpha2.SchemeBuilder.AddToScheme) + AddToSchemes = append(AddToSchemes, routev1.Install) + AddToSchemes = append(AddToSchemes, appsv1.AddToScheme) }