pkg/scheduler/framework/:fix unconsistent comments and make log more clear

This commit is contained in:
tanjunchen
2020-04-24 11:17:11 +08:00
parent aef471ec3c
commit 0e38ba0ef6
2 changed files with 4 additions and 6 deletions

View File

@@ -18,8 +18,6 @@ package prebind
import (
"context"
"fmt"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
@@ -42,7 +40,7 @@ func (sr StatelessPreBindExample) Name() string {
// PreBind is the functions invoked by the framework at "prebind" extension point.
func (sr StatelessPreBindExample) PreBind(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status {
if pod == nil {
return framework.NewStatus(framework.Error, fmt.Sprintf("pod cannot be nil"))
return framework.NewStatus(framework.Error, "pod cannot be nil")
}
if pod.Namespace != "foo" {
return framework.NewStatus(framework.Unschedulable, "only pods from 'foo' namespace are allowed")