Skip to content

Commit

Permalink
Merge pull request #278 from fluxcd/panic-non-nil-err
Browse files Browse the repository at this point in the history
Panic on non-nil AddToScheme errors in main init
  • Loading branch information
hiddeco authored Jun 18, 2021
2 parents 1bfe1d9 + 43ee4dc commit 893d804
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

flag "github.com/spf13/pflag"
"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"
Expand Down Expand Up @@ -50,10 +51,10 @@ var (
)

func init() {
_ = clientgoscheme.AddToScheme(scheme)
utilruntime.Must(clientgoscheme.AddToScheme(scheme))

_ = sourcev1.AddToScheme(scheme)
_ = v2.AddToScheme(scheme)
utilruntime.Must(sourcev1.AddToScheme(scheme))
utilruntime.Must(v2.AddToScheme(scheme))
// +kubebuilder:scaffold:scheme
}

Expand Down

0 comments on commit 893d804

Please sign in to comment.