Change the scheduler plugins PluginFactory function to use context parameter to pass logger

- Migrated pkg/scheduler/framework/plugins/nodevolumelimits to use contextual logging
- Fix golangci-lint validation failed
- Check for plugins creation err
This commit is contained in:
Mengjiao Liu
2023-09-06 11:55:33 +08:00
parent f9f00da6bc
commit a7466f44e0
53 changed files with 287 additions and 218 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package interpodaffinity
import (
"context"
"fmt"
"k8s.io/apimachinery/pkg/labels"
@@ -69,7 +70,7 @@ func (pl *InterPodAffinity) EventsToRegister() []framework.ClusterEventWithHint
}
// New initializes a new plugin and returns it.
func New(plArgs runtime.Object, h framework.Handle) (framework.Plugin, error) {
func New(_ context.Context, plArgs runtime.Object, h framework.Handle) (framework.Plugin, error) {
if h.SnapshotSharedLister() == nil {
return nil, fmt.Errorf("SnapshotSharedlister is nil")
}