Skip to content

Commit

Permalink
fix StatefulSet down scale
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Sep 26, 2021
1 parent 506e95d commit be8b5ea
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,7 @@ func isStatefulSetPodToDel(c kubernetes.Interface, pod *v1.Pod, statefulSetName
return false
}

if index >= int64(*ss.Spec.Replicas) {
return true
}

return false
return index >= int64(*ss.Spec.Replicas) && index >= int64(ss.Status.Replicas)
}

func getNodeTunlIP(node *v1.Node) ([]net.IP, error) {
Expand Down

0 comments on commit be8b5ea

Please sign in to comment.