From a162b083aa1749002bca7c03f38efd39aa9af44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Wed, 6 Feb 2019 15:56:56 +0100 Subject: [PATCH] Added Route to SDK Scheme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- Gopkg.lock | 9 +++++-- pkg/controller/controller.go | 5 ++++ .../github.com/openshift/api/route/install.go | 26 +++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 vendor/github.com/openshift/api/route/install.go diff --git a/Gopkg.lock b/Gopkg.lock index 5b283eaca..d221d1320 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -331,9 +331,12 @@ [[projects]] branch = "release-3.11" - digest = "1:416ab68f11332bbaad8d2ee219dccb42e06f2e4321eb5dc210adc86f860e1004" + digest = "1:1e9d328e3e116fb71d883b4f5c3b952995af89b767e5a9fd5a75853e3065c850" name = "github.com/openshift/api" - packages = ["route/v1"] + packages = [ + "route", + "route/v1", + ] pruneopts = "NUT" revision = "5ad8479f64f1b60ee9c62ce8ef1fe6638838725e" @@ -929,6 +932,7 @@ analyzer-version = 1 input-imports = [ "github.com/mitchellh/go-homedir", + "github.com/openshift/api/route", "github.com/openshift/api/route/v1", "github.com/operator-framework/operator-sdk/pkg/k8sutil", "github.com/operator-framework/operator-sdk/pkg/test", @@ -941,6 +945,7 @@ "github.com/uber/jaeger-client-go/config", "k8s.io/api/apps/v1", "k8s.io/api/batch/v1", + "k8s.io/api/batch/v1beta1", "k8s.io/api/core/v1", "k8s.io/api/extensions/v1beta1", "k8s.io/apimachinery/pkg/api/errors", diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 7c069f3ee..cc03cc1c6 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -1,6 +1,7 @@ package controller import ( + routev1 "github.com/openshift/api/route/v1" "sigs.k8s.io/controller-runtime/pkg/manager" ) @@ -9,6 +10,10 @@ var AddToManagerFuncs []func(manager.Manager) error // AddToManager adds all Controllers to the Manager func AddToManager(m manager.Manager) error { + if err := routev1.AddToScheme(m.GetScheme()); err != nil { + return err + } + for _, f := range AddToManagerFuncs { if err := f(m); err != nil { return err diff --git a/vendor/github.com/openshift/api/route/install.go b/vendor/github.com/openshift/api/route/install.go new file mode 100644 index 000000000..a08536283 --- /dev/null +++ b/vendor/github.com/openshift/api/route/install.go @@ -0,0 +1,26 @@ +package route + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + routev1 "github.com/openshift/api/route/v1" +) + +const ( + GroupName = "route.openshift.io" +) + +var ( + schemeBuilder = runtime.NewSchemeBuilder(routev1.Install) + // Install is a function which adds every version of this group to a scheme + Install = schemeBuilder.AddToScheme +) + +func Resource(resource string) schema.GroupResource { + return schema.GroupResource{Group: GroupName, Resource: resource} +} + +func Kind(kind string) schema.GroupKind { + return schema.GroupKind{Group: GroupName, Kind: kind} +}