Internal weight field for affinity must be int32

This commit is contained in:
Clayton Coleman 2016-10-14 00:50:26 -04:00
parent 65042efb0f
commit 07bd50be0d
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3
2 changed files with 2 additions and 2 deletions

View File

@ -1605,7 +1605,7 @@ type PodAntiAffinity struct {
type WeightedPodAffinityTerm struct {
// weight associated with matching the corresponding podAffinityTerm,
// in the range 1-100.
Weight int `json:"weight"`
Weight int32 `json:"weight"`
// Required. A pod affinity term, associated with the corresponding weight.
PodAffinityTerm PodAffinityTerm `json:"podAffinityTerm"`
}

View File

@ -105,7 +105,7 @@ func (p *podAffinityPriorityMap) processTerm(term *api.PodAffinityTerm, podDefin
func (p *podAffinityPriorityMap) processTerms(terms []api.WeightedPodAffinityTerm, podDefiningAffinityTerm, podToCheck *api.Pod, fixedNode *api.Node, multiplier int) {
for i := range terms {
term := &terms[i]
p.processTerm(&term.PodAffinityTerm, podDefiningAffinityTerm, podToCheck, fixedNode, float64(term.Weight*multiplier))
p.processTerm(&term.PodAffinityTerm, podDefiningAffinityTerm, podToCheck, fixedNode, float64(term.Weight*int32(multiplier)))
}
}