1
0
Fork 0
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:
Kubernetes Prow Robot 2024-03-27 11:54:14 -07:00 committed by GitHub
commit 1696c6589e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}