1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

topology-gc: rename run()

Too many run methods here.
This commit is contained in:
Markus Lehtonen 2023-08-17 17:48:21 +03:00
parent fe0763eccb
commit 98b0b36b87
2 changed files with 6 additions and 6 deletions

View file

@ -158,7 +158,7 @@ func (n *topologyGC) periodicGC(gcPeriod time.Duration) {
}
}
func (n *topologyGC) run() error {
func (n *topologyGC) startNodeInformer() error {
nodeInformer := n.factory.Core().V1().Nodes().Informer()
if _, err := nodeInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{
@ -178,7 +178,7 @@ func (n *topologyGC) run() error {
// Run is a blocking function that removes stale NRT objects when Node is deleted and runs periodic GC to make sure any obsolete objects are removed
func (n *topologyGC) Run() error {
if err := n.run(); err != nil {
if err := n.startNodeInformer(); err != nil {
return err
}
// run periodic GC

View file

@ -51,7 +51,7 @@ func TestNRTGC(t *testing.T) {
gcPeriod: 10 * time.Minute,
}
err := gc.run()
err := gc.startNodeInformer()
So(err, ShouldBeNil)
nrts, err := fakeClient.TopologyV1alpha2().NodeResourceTopologies().List(context.TODO(), metav1.ListOptions{})
@ -90,7 +90,7 @@ func TestNRTGC(t *testing.T) {
gcPeriod: 10 * time.Minute,
}
err := gc.run()
err := gc.startNodeInformer()
So(err, ShouldBeNil)
nrts, err := fakeClient.TopologyV1alpha2().NodeResourceTopologies().List(context.TODO(), metav1.ListOptions{})
@ -136,7 +136,7 @@ func TestNRTGC(t *testing.T) {
gcPeriod: 10 * time.Minute,
}
err := gc.run()
err := gc.startNodeInformer()
So(err, ShouldBeNil)
nrts, err := fakeClient.TopologyV1alpha2().NodeResourceTopologies().List(context.TODO(), metav1.ListOptions{})
@ -197,7 +197,7 @@ func TestNRTGC(t *testing.T) {
gcPeriod: time.Second,
}
err := gc.run()
err := gc.startNodeInformer()
So(err, ShouldBeNil)
nrts, err := fakeClient.TopologyV1alpha2().NodeResourceTopologies().List(context.TODO(), metav1.ListOptions{})