Merge pull request #83365 from notpad/feature/83244

A consistent interface for plugin extended functionality
This commit is contained in:
Kubernetes Prow Robot
2019-10-01 13:01:11 -07:00
committed by GitHub
8 changed files with 85 additions and 72 deletions

View File

@@ -162,7 +162,7 @@ func (sp *ScorePlugin) Score(pc *framework.PluginContext, p *v1.Pod, nodeName st
return score, nil
}
func (sp *ScorePlugin) NormalizeScore(pc *framework.PluginContext, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status {
func (sp *ScorePlugin) Extensions() framework.ScoreExtensions {
return nil
}
@@ -189,6 +189,10 @@ func (sp *ScoreWithNormalizePlugin) NormalizeScore(pc *framework.PluginContext,
return nil
}
func (sp *ScoreWithNormalizePlugin) Extensions() framework.ScoreExtensions {
return sp
}
// Name returns name of the plugin.
func (fp *FilterPlugin) Name() string {
return filterPluginName
@@ -330,8 +334,8 @@ func (pp *PreFilterPlugin) Name() string {
return prefilterPluginName
}
// Updater returns the updater interface.
func (pp *PreFilterPlugin) Updater() framework.Updater {
// Extensions returns the PreFilterExtensions interface.
func (pp *PreFilterPlugin) Extensions() framework.PreFilterExtensions {
return nil
}

View File

@@ -111,7 +111,7 @@ func (fp *tokenFilter) RemovePod(pc *framework.PluginContext, podToSchedule *v1.
return nil
}
func (fp *tokenFilter) Updater() framework.Updater {
func (fp *tokenFilter) Extensions() framework.PreFilterExtensions {
return fp
}