From cb86e4a7709c680e5f3476b35e7bf4f18f3aae99 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 8 Nov 2020 18:20:33 -0800 Subject: [PATCH] ensure the image version matches expected version fix https://github.com/seaweedfs/seaweedfs-operator/issues/25 --- controllers/controller_master.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/controller_master.go b/controllers/controller_master.go index 7f8d266..1fa2b1e 100644 --- a/controllers/controller_master.go +++ b/controllers/controller_master.go @@ -59,7 +59,12 @@ func (r *SeaweedReconciler) waitForMasterStatefulSet(seaweedCR *seaweedv1.Seawee runningCounter := 0 for _, pod := range podList.Items { if pod.Status.Phase == corev1.PodRunning { - runningCounter++ + for _, containerStatus := range pod.Status.ContainerStatuses { + if containerStatus.Image == seaweedCR.Spec.Image { + runningCounter++ + break + } + } } else { log.Info("pod", "name", pod.Name, "status", pod.Status) }