Skip to content

Commit

Permalink
Merge pull request #1645 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1641-to-release-0.14

[release-0.14] nfd-master: do nfd API scheme registration in an init function
  • Loading branch information
k8s-ci-robot authored Mar 28, 2024
2 parents fc4d8bd + 37e8c6c commit 3cbf845
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 3cbf845

Please sign in to comment.