Skip to content

Commit

Permalink
[KNI][[REVERT][downstream] nrt: add optional kni-specific informer
Browse files Browse the repository at this point in the history
This reverts commit 0338ae3.
  • Loading branch information
ffromani committed Jul 24, 2024
1 parent 457b063 commit 81f3bbd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 98 deletions.
3 changes: 0 additions & 3 deletions cmd/noderesourcetopology-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
_ "sigs.k8s.io/scheduler-plugins/apis/config/scheme"

knifeatures "sigs.k8s.io/scheduler-plugins/pkg-kni/features"
kniinformer "sigs.k8s.io/scheduler-plugins/pkg-kni/podinformer"

"github.com/k8stopologyawareschedwg/podfingerprint"
)
Expand Down Expand Up @@ -66,8 +65,6 @@ func main() {

rand.Seed(time.Now().UnixNano())

kniinformer.Setup()

// Register custom plugins to the scheduler framework.
// Later they can consist of scheduler profile(s) and hence
// used by various kinds of workloads.
Expand Down
89 changes: 0 additions & 89 deletions pkg-kni/podinformer/podinformer.go

This file was deleted.

4 changes: 1 addition & 3 deletions pkg/noderesourcetopology/cache/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ import (
"sigs.k8s.io/scheduler-plugins/pkg/noderesourcetopology/resourcerequests"
"sigs.k8s.io/scheduler-plugins/pkg/noderesourcetopology/stringify"
"sigs.k8s.io/scheduler-plugins/pkg/util"

kniinformer "sigs.k8s.io/scheduler-plugins/pkg-kni/podinformer"
)

// nrtStore maps the NRT data by node name. It is not thread safe and needs to be protected by a lock.
Expand Down Expand Up @@ -255,7 +253,7 @@ func makeNodeToPodDataMap(podLister podlisterv1.PodLister, logID string) (map[st
return nodeToObjsMap, err
}
for _, pod := range pods {
if !kniinformer.IsPodRelevantForState(pod) {
if pod.Status.Phase != corev1.PodRunning {
// we are interested only about nodes which consume resources
continue
}
Expand Down
4 changes: 1 addition & 3 deletions pkg/noderesourcetopology/pluginhelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ import (
apiconfig "sigs.k8s.io/scheduler-plugins/apis/config"
nrtcache "sigs.k8s.io/scheduler-plugins/pkg/noderesourcetopology/cache"
"sigs.k8s.io/scheduler-plugins/pkg/noderesourcetopology/stringify"

kniinformer "sigs.k8s.io/scheduler-plugins/pkg-kni/podinformer"
)

const (
Expand All @@ -56,7 +54,7 @@ func initNodeTopologyInformer(tcfg *apiconfig.NodeResourceTopologyMatchArgs, han
return nrtcache.NewPassthrough(client), nil
}

podSharedInformer, podLister := kniinformer.FromHandle(handle)
podSharedInformer, podLister := nrtcache.InformerFromHandle(handle)

nrtCache, err := nrtcache.NewOverReserve(tcfg.Cache, client, podLister)
if err != nil {
Expand Down

0 comments on commit 81f3bbd

Please sign in to comment.