Skip to content

Commit

Permalink
Merge pull request #1641 from marquiz/devel/fix-master-crash
Browse files Browse the repository at this point in the history
nfd-master: do nfd API scheme registration in an init function
  • Loading branch information
k8s-ci-robot authored Mar 27, 2024
2 parents 137f18b + c4e010e commit 1696c65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/nfd-master/nfd-api-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 1696c65

Please sign in to comment.