Skip to content

Commit

Permalink
Merge pull request #906 from marquiz/devel/master-controller-rename
Browse files Browse the repository at this point in the history
nfd-master: rename crd controller
  • Loading branch information
k8s-ci-robot authored Oct 6, 2022
2 parents 0ec98a5 + 658ffaa commit 906aad6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes Authors.
Copyright 2021-2022 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,7 @@ import (
)

type nfdController struct {
lister nfdlisters.NodeFeatureRuleLister
ruleLister nfdlisters.NodeFeatureRuleLister

stopChan chan struct{}
}
Expand All @@ -45,8 +45,8 @@ func newNfdController(config *restclient.Config) *nfdController {
nfdClient := nfdclientset.NewForConfigOrDie(config)

informerFactory := nfdinformers.NewSharedInformerFactory(nfdClient, 5*time.Minute)
informer := informerFactory.Nfd().V1alpha1().NodeFeatureRules()
informer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
ruleInformer := informerFactory.Nfd().V1alpha1().NodeFeatureRules()
ruleInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(object interface{}) {
key, _ := cache.MetaNamespaceKeyFunc(object)
klog.V(2).Infof("NodeFeatureRule %v added", key)
Expand All @@ -64,7 +64,7 @@ func newNfdController(config *restclient.Config) *nfdController {

utilruntime.Must(nfdv1alpha1.AddToScheme(nfdscheme.Scheme))

c.lister = informer.Lister()
c.ruleLister = ruleInformer.Lister()

return c
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/nfd-master/nfd-master.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ func (m *nfdMaster) crLabels(r *pb.SetLabelsRequest) map[string]string {
}

l := make(map[string]string)
ruleSpecs, err := m.nfdController.lister.List(labels.Everything())
ruleSpecs, err := m.nfdController.ruleLister.List(labels.Everything())
sort.Slice(ruleSpecs, func(i, j int) bool {
return ruleSpecs[i].Name < ruleSpecs[j].Name
})
Expand Down

0 comments on commit 906aad6

Please sign in to comment.