diff --git a/pkg/nfd-master/nfd-api-controller.go b/pkg/nfd-master/nfd-api-controller.go index b1d734c750..af86b2b45c 100644 --- a/pkg/nfd-master/nfd-api-controller.go +++ b/pkg/nfd-master/nfd-api-controller.go @@ -49,6 +49,10 @@ type nfdApiControllerOptions struct { ResyncPeriod time.Duration } +func init() { + utilruntime.Must(nfdv1alpha1.AddToScheme(nfdscheme.Scheme)) +} + func newNfdController(config *restclient.Config, nfdApiControllerOptions nfdApiControllerOptions) (*nfdController, error) { c := &nfdController{ stopChan: make(chan struct{}, 1), @@ -118,7 +122,6 @@ func newNfdController(config *restclient.Config, nfdApiControllerOptions nfdApiC // Start informers informerFactory.Start(c.stopChan) - utilruntime.Must(nfdv1alpha1.AddToScheme(nfdscheme.Scheme)) return c, nil }