syn2mas: fail if pods are still up after statefulset are all down

This commit is contained in:
Gaël Goinvic committed 2025-06-06 17:43:21 +02:00
1 parent a22fdd2ef0
commit c3cd3cf153
1 file changed
+13
@@ -59,6 +59,19 @@ func scaleDownSynapse(client kubernetes.Interface, namespace string) map[string]
break
}
}
podsClient := client.CoreV1().Pods(namespace)
pods, err := podsClient.List(ctx, metav1.ListOptions{
LabelSelector: "app.kubernetes.io/component=matrix-server",
})
if err != nil {
fmt.Println(err)
os.Exit(1)
}
if len(pods.Items) != 0 {
fmt.Println("StatefulSet are down, but pods matching matrix-server component are remaining. Something wrong is happening.")
os.Exit(1)
}
return stsReplicas
}