ensure the image version matches expected version

fix https://github.com/seaweedfs/seaweedfs-operator/issues/25
This commit is contained in:
Chris Lu 2020-11-08 18:20:33 -08:00
parent 8342be9b1c
commit cb86e4a770
1 changed files with 6 additions and 1 deletions

View File

@ -59,7 +59,12 @@ func (r *SeaweedReconciler) waitForMasterStatefulSet(seaweedCR *seaweedv1.Seawee
runningCounter := 0 runningCounter := 0
for _, pod := range podList.Items { for _, pod := range podList.Items {
if pod.Status.Phase == corev1.PodRunning { if pod.Status.Phase == corev1.PodRunning {
runningCounter++ for _, containerStatus := range pod.Status.ContainerStatuses {
if containerStatus.Image == seaweedCR.Spec.Image {
runningCounter++
break
}
}
} else { } else {
log.Info("pod", "name", pod.Name, "status", pod.Status) log.Info("pod", "name", pod.Name, "status", pod.Status)
} }