Skip to content

Commit bbc4931

Browse files
yiyang5055yiyang
authored andcommitted
fix error package name and rename struct
1 parent ba07527 commit bbc4931

File tree

1 file changed

+8
-7
lines changed
  • pkg/scheduler/framework/plugins/noop

1 file changed

+8
-7
lines changed

pkg/scheduler/framework/plugins/noop/noop.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package prebind
17+
package noop
1818

1919
import (
2020
"k8s.io/api/core/v1"
@@ -23,27 +23,28 @@ import (
2323
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
2424
)
2525

26-
// NoOpFilter is a plugin that implements the filter plugin and always returns Success.
26+
// Filter is a plugin that implements the filter plugin and always returns Success.
2727
// This is just to make sure that all code dependencies are properly addressed while
2828
// working on legitimate plugins.
29-
type NoOpFilter struct{}
29+
// Note: The struct cannot be named NoOpFilter, otherwise the golint check cannot pass
30+
type Filter struct{}
3031

31-
var _ = framework.FilterPlugin(NoOpFilter{})
32+
var _ = framework.FilterPlugin(Filter{})
3233

3334
// Name is the name of the plugin used in Registry and configurations.
3435
const Name = "noop-filter"
3536

3637
// Name returns name of the plugin. It is used in logs, etc.
37-
func (n NoOpFilter) Name() string {
38+
func (n Filter) Name() string {
3839
return Name
3940
}
4041

4142
// Filter invoked at the filter extension point.
42-
func (n NoOpFilter) Filter(pc *framework.PluginContext, pod *v1.Pod, nodeName string) *framework.Status {
43+
func (n Filter) Filter(pc *framework.PluginContext, pod *v1.Pod, nodeName string) *framework.Status {
4344
return nil
4445
}
4546

4647
// New initializes a new plugin and returns it.
4748
func New(_ *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
48-
return &NoOpFilter{}, nil
49+
return &Filter{}, nil
4950
}

0 commit comments

Comments
 (0)