Skip to content

Commit

Permalink
koordlet: remove useless stateInformer.impl StateInformer interface (#…
Browse files Browse the repository at this point in the history
…2286)

Signed-off-by: j4ckstraw <[email protected]>
  • Loading branch information
j4ckstraw authored Dec 2, 2024
1 parent 13a7107 commit d06699e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
4 changes: 2 additions & 2 deletions pkg/koordlet/statesinformer/impl/callback_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type UpdateCbCtx struct{}
type callbackRunner struct {
callbackChans map[statesinformer.RegisterType]chan UpdateCbCtx
stateUpdateCallbacks map[statesinformer.RegisterType][]updateCallback
statesInformer StatesInformer
statesInformer statesinformer.StatesInformer
}

func NewCallbackRunner() *callbackRunner {
Expand All @@ -53,7 +53,7 @@ func NewCallbackRunner() *callbackRunner {
return c
}

func (s *callbackRunner) Setup(i StatesInformer) {
func (s *callbackRunner) Setup(i statesinformer.StatesInformer) {
s.statesInformer = i
}

Expand Down
21 changes: 2 additions & 19 deletions pkg/koordlet/statesinformer/impl/states_informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,6 @@ const (
HTTPSScheme = "https"
)

type StatesInformer interface {
Run(stopCh <-chan struct{}) error
HasSynced() bool

GetNode() *corev1.Node
GetNodeSLO() *slov1alpha1.NodeSLO
GetNodeMetricSpec() *slov1alpha1.NodeMetricSpec

GetAllPods() []*statesinformer.PodMeta

GetNodeTopo() *topov1alpha1.NodeResourceTopology

GetVolumeName(pvcNamespace, pvcName string) string

RegisterCallbacks(objType statesinformer.RegisterType, name, description string, callbackFn statesinformer.UpdateCbFn)
}

type PluginName string

type PluginOption struct {
Expand Down Expand Up @@ -102,11 +85,11 @@ type informerPlugin interface {
HasSynced() bool
}

var _ StatesInformer = &statesInformer{}
var _ statesinformer.StatesInformer = &statesInformer{}

// TODO merge all clients into one struct
func NewStatesInformer(config *Config, kubeClient clientset.Interface, crdClient koordclientset.Interface, topologyClient topologyclientset.Interface,
metricsCache metriccache.MetricCache, nodeName string, schedulingClient schedv1alpha1.SchedulingV1alpha1Interface, predictorFactory prediction.PredictorFactory) StatesInformer {
metricsCache metriccache.MetricCache, nodeName string, schedulingClient schedv1alpha1.SchedulingV1alpha1Interface, predictorFactory prediction.PredictorFactory) statesinformer.StatesInformer {
opt := &PluginOption{
config: config,
KubeClient: kubeClient,
Expand Down

0 comments on commit d06699e

Please sign in to comment.