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 4c189b7 commit f0bebbe
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 @@ -804,11 +804,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 f0bebbe

Please sign in to comment.