Exclude terminated pods from the blocking mechanism

Terminated pods should be excluded from the blocking a reboot as per https://github.com/weaveworks/kured/issues/227

This adds status filters to the fieldSelector in order to do that. I've not updated tests here but have successfully tested the exact same filter using kubectl
This commit is contained in:
georgekaz
2021-11-05 16:48:36 +00:00
committed by GitHub
parent 348b5b4c96
commit d3b59b8922
+1 -1
View File
@@ -284,7 +284,7 @@ func (pb PrometheusBlockingChecker) isBlocked() bool {
}
func (kb KubernetesBlockingChecker) isBlocked() bool {
fieldSelector := fmt.Sprintf("spec.nodeName=%s", kb.nodename)
fieldSelector := fmt.Sprintf("spec.nodeName=%s,status.phase!=Succeeded,status.phase!=Failed,status.phase!=Unknown", kb.nodename)
for _, labelSelector := range kb.filter {
podList, err := kb.client.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{
LabelSelector: labelSelector,