mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
Addressed comments
This commit is contained in:
parent
bc550b0896
commit
1751c251d8
@ -556,7 +556,7 @@ func (g *genericScheduler) findNodesThatFit(state *framework.CycleState, pod *v1
|
|||||||
|
|
||||||
// addNominatedPods adds pods with equal or greater priority which are nominated
|
// addNominatedPods adds pods with equal or greater priority which are nominated
|
||||||
// to run on the node given in nodeInfo to meta and nodeInfo. It returns 1) whether
|
// to run on the node given in nodeInfo to meta and nodeInfo. It returns 1) whether
|
||||||
// any pod was added, 2) augmented meta data, 3) augmented nodeInfo.
|
// any pod was added, 2) augmented metadata, 3) augmented CycleState 4) augmented nodeInfo.
|
||||||
func (g *genericScheduler) addNominatedPods(pod *v1.Pod, meta predicates.PredicateMetadata, state *framework.CycleState,
|
func (g *genericScheduler) addNominatedPods(pod *v1.Pod, meta predicates.PredicateMetadata, state *framework.CycleState,
|
||||||
nodeInfo *schedulernodeinfo.NodeInfo, queue internalqueue.SchedulingQueue) (bool, predicates.PredicateMetadata,
|
nodeInfo *schedulernodeinfo.NodeInfo, queue internalqueue.SchedulingQueue) (bool, predicates.PredicateMetadata,
|
||||||
*framework.CycleState, *schedulernodeinfo.NodeInfo, error) {
|
*framework.CycleState, *schedulernodeinfo.NodeInfo, error) {
|
||||||
@ -640,7 +640,7 @@ func (g *genericScheduler) podFitsOnNode(
|
|||||||
stateToUse := state
|
stateToUse := state
|
||||||
nodeInfoToUse := info
|
nodeInfoToUse := info
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
err := error(nil)
|
var err error
|
||||||
podsAdded, metaToUse, stateToUse, nodeInfoToUse, err = g.addNominatedPods(pod, meta, state, info, queue)
|
podsAdded, metaToUse, stateToUse, nodeInfoToUse, err = g.addNominatedPods(pod, meta, state, info, queue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, []predicates.PredicateFailureReason{}, nil, err
|
return false, []predicates.PredicateFailureReason{}, nil, err
|
||||||
|
@ -21,6 +21,14 @@ import (
|
|||||||
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
|
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// PredicatesStateKey is the key in CycleState to PredicateStateData
|
||||||
|
PredicatesStateKey = "predicates"
|
||||||
|
|
||||||
|
// PrioritiesStateKey is the key in CycleState to PrioritiesStateData
|
||||||
|
PrioritiesStateKey = "priorities"
|
||||||
|
)
|
||||||
|
|
||||||
// PredicateResultToFrameworkStatus converts a predicate result (PredicateFailureReason + error)
|
// PredicateResultToFrameworkStatus converts a predicate result (PredicateFailureReason + error)
|
||||||
// to a framework status.
|
// to a framework status.
|
||||||
func PredicateResultToFrameworkStatus(reasons []predicates.PredicateFailureReason, err error) *framework.Status {
|
func PredicateResultToFrameworkStatus(reasons []predicates.PredicateFailureReason, err error) *framework.Status {
|
||||||
@ -48,14 +56,6 @@ func ErrorToFrameworkStatus(err error) *framework.Status {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
// PredicatesStateKey is the key in CycleState to PredicateStateData
|
|
||||||
PredicatesStateKey = "predicates"
|
|
||||||
|
|
||||||
// PrioritiesStateKey is the key in CycleState to PrioritiesStateData
|
|
||||||
PrioritiesStateKey = "priorities"
|
|
||||||
)
|
|
||||||
|
|
||||||
// PredicatesStateData is a pointer to PredicateMetadata. In the normal case, StateData is supposed to
|
// PredicatesStateData is a pointer to PredicateMetadata. In the normal case, StateData is supposed to
|
||||||
// be generated and stored in CycleState by a framework plugin (like a PreFilter pre-computing data for
|
// be generated and stored in CycleState by a framework plugin (like a PreFilter pre-computing data for
|
||||||
// its corresponding Filter). However, during migration, the scheduler will inject a pointer to
|
// its corresponding Filter). However, during migration, the scheduler will inject a pointer to
|
||||||
|
Loading…
Reference in New Issue
Block a user