mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 14:11:14 +00:00
Fixing gofmt errors
This commit is contained in:
@@ -150,9 +150,9 @@ func EqualPriority(pod api.Pod, podLister PodLister, minionLister MinionLister)
|
|||||||
|
|
||||||
func NewGenericScheduler(predicates []FitPredicate, prioritizers []PriorityFunction, pods PodLister, random *rand.Rand) Scheduler {
|
func NewGenericScheduler(predicates []FitPredicate, prioritizers []PriorityFunction, pods PodLister, random *rand.Rand) Scheduler {
|
||||||
return &genericScheduler{
|
return &genericScheduler{
|
||||||
predicates: predicates,
|
predicates: predicates,
|
||||||
prioritizers: prioritizers,
|
prioritizers: prioritizers,
|
||||||
pods: pods,
|
pods: pods,
|
||||||
random: random,
|
random: random,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -50,7 +50,7 @@ func CalculateSpreadPriority(pod api.Pod, podLister PodLister, minionLister Mini
|
|||||||
// than the filtered minion count
|
// than the filtered minion count
|
||||||
values := make([]int, len(counts))
|
values := make([]int, len(counts))
|
||||||
idx := 0
|
idx := 0
|
||||||
for _, count := range counts {
|
for _, count := range counts {
|
||||||
values[idx] = count
|
values[idx] = count
|
||||||
idx++
|
idx++
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ func CalculateSpreadPriority(pod api.Pod, podLister PodLister, minionLister Mini
|
|||||||
//score int
|
//score int
|
||||||
for _, minion := range minions.Items {
|
for _, minion := range minions.Items {
|
||||||
if maxCount > 0 {
|
if maxCount > 0 {
|
||||||
fScore = 100 * ( float32(counts[minion.Name]) / float32(maxCount) )
|
fScore = 100 * (float32(counts[minion.Name]) / float32(maxCount))
|
||||||
}
|
}
|
||||||
result = append(result, HostPriority{host: minion.Name, score: int(fScore)})
|
result = append(result, HostPriority{host: minion.Name, score: int(fScore)})
|
||||||
}
|
}
|
||||||
|
@@ -58,11 +58,11 @@ type configFactory struct {
|
|||||||
func NewConfigFactory(client *client.Client) *configFactory {
|
func NewConfigFactory(client *client.Client) *configFactory {
|
||||||
// initialize the factory struct
|
// initialize the factory struct
|
||||||
factory := &configFactory{Client: client,
|
factory := &configFactory{Client: client,
|
||||||
PodQueue: cache.NewFIFO(),
|
PodQueue: cache.NewFIFO(),
|
||||||
PodLister: &storeToPodLister{cache.NewStore()},
|
PodLister: &storeToPodLister{cache.NewStore()},
|
||||||
MinionLister: &storeToMinionLister{cache.NewStore()},
|
MinionLister: &storeToMinionLister{cache.NewStore()},
|
||||||
PredicateMap: make(map[string]algorithm.FitPredicate),
|
PredicateMap: make(map[string]algorithm.FitPredicate),
|
||||||
PriorityMap: make(map[string]algorithm.PriorityFunction),
|
PriorityMap: make(map[string]algorithm.PriorityFunction),
|
||||||
}
|
}
|
||||||
|
|
||||||
// add default predicates
|
// add default predicates
|
||||||
|
Reference in New Issue
Block a user