Skip to content

Commit 3cbf845

Browse files
authored
Merge pull request #1645 from k8s-infra-cherrypick-robot/cherry-pick-1641-to-release-0.14
[release-0.14] nfd-master: do nfd API scheme registration in an init function
2 parents fc4d8bd + 37e8c6c commit 3cbf845

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)