Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

koordlet: remove useless stateInformer.impl StateInformer interface #2286

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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