From 896489680e0833b56171aa3e56800f4167b074c9 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Thu, 17 Jun 2021 15:22:43 +0200 Subject: [PATCH] Panic on non-nil AddToScheme errors in main init Signed-off-by: Hidde Beydals --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index b1e513d2f..55a2d2f97 100644 --- a/main.go +++ b/main.go @@ -29,6 +29,7 @@ import ( flag "github.com/spf13/pflag" "helm.sh/helm/v3/pkg/getter" "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" ctrl "sigs.k8s.io/controller-runtime" @@ -61,9 +62,9 @@ var ( ) func init() { - _ = clientgoscheme.AddToScheme(scheme) + utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - _ = sourcev1.AddToScheme(scheme) + utilruntime.Must(sourcev1.AddToScheme(scheme)) // +kubebuilder:scaffold:scheme }