mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #95632 from mrkm4ntr/remove-redundant-variable
Remove redundant variable
This commit is contained in:
commit
153d33091b
@ -17,7 +17,6 @@ limitations under the License.
|
|||||||
package statefulset
|
package statefulset
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
apps "k8s.io/api/apps/v1"
|
apps "k8s.io/api/apps/v1"
|
||||||
@ -299,7 +298,6 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet(
|
|||||||
// slice that will contain all Pods such that set.Spec.Replicas <= getOrdinal(pod)
|
// slice that will contain all Pods such that set.Spec.Replicas <= getOrdinal(pod)
|
||||||
condemned := make([]*v1.Pod, 0, len(pods))
|
condemned := make([]*v1.Pod, 0, len(pods))
|
||||||
unhealthy := 0
|
unhealthy := 0
|
||||||
firstUnhealthyOrdinal := math.MaxInt32
|
|
||||||
var firstUnhealthyPod *v1.Pod
|
var firstUnhealthyPod *v1.Pod
|
||||||
|
|
||||||
// First we partition pods into two lists valid replicas and condemned Pods
|
// First we partition pods into two lists valid replicas and condemned Pods
|
||||||
@ -351,8 +349,7 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet(
|
|||||||
for i := range replicas {
|
for i := range replicas {
|
||||||
if !isHealthy(replicas[i]) {
|
if !isHealthy(replicas[i]) {
|
||||||
unhealthy++
|
unhealthy++
|
||||||
if ord := getOrdinal(replicas[i]); ord < firstUnhealthyOrdinal {
|
if firstUnhealthyPod == nil {
|
||||||
firstUnhealthyOrdinal = ord
|
|
||||||
firstUnhealthyPod = replicas[i]
|
firstUnhealthyPod = replicas[i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -361,8 +358,7 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet(
|
|||||||
for i := range condemned {
|
for i := range condemned {
|
||||||
if !isHealthy(condemned[i]) {
|
if !isHealthy(condemned[i]) {
|
||||||
unhealthy++
|
unhealthy++
|
||||||
if ord := getOrdinal(condemned[i]); ord < firstUnhealthyOrdinal {
|
if firstUnhealthyPod == nil {
|
||||||
firstUnhealthyOrdinal = ord
|
|
||||||
firstUnhealthyPod = condemned[i]
|
firstUnhealthyPod = condemned[i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user