mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-28 02:37:11 +00:00
Merge pull request #1641 from marquiz/devel/fix-master-crash
nfd-master: do nfd API scheme registration in an init function
This commit is contained in:
commit
1696c6589e
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue