Skip to content

Commit 1696c65

Browse files
authored
Merge pull request #1641 from marquiz/devel/fix-master-crash
nfd-master: do nfd API scheme registration in an init function
2 parents 137f18b + c4e010e commit 1696c65

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/nfd-master/nfd-api-controller.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ type nfdApiControllerOptions struct {
4949
ResyncPeriod time.Duration
5050
}
5151

52+
func init() {
53+
utilruntime.Must(nfdv1alpha1.AddToScheme(nfdscheme.Scheme))
54+
}
55+
5256
func newNfdController(config *restclient.Config, nfdApiControllerOptions nfdApiControllerOptions) (*nfdController, error) {
5357
c := &nfdController{
5458
stopChan: make(chan struct{}, 1),
@@ -118,7 +122,6 @@ func newNfdController(config *restclient.Config, nfdApiControllerOptions nfdApiC
118122
// Start informers
119123
informerFactory.Start(c.stopChan)
120124

121-
utilruntime.Must(nfdv1alpha1.AddToScheme(nfdscheme.Scheme))
122125
return c, nil
123126
}
124127

0 commit comments

Comments
 (0)