fix image comparison

This commit is contained in:
Chris Lu 2020-11-08 23:58:48 -08:00
parent ce9dc2bee8
commit 831adc091f
2 changed files with 7 additions and 7 deletions

View File

@ -2,9 +2,10 @@ apiVersion: seaweed.seaweedfs.com/v1
kind: Seaweed kind: Seaweed
metadata: metadata:
name: seaweed1 name: seaweed1
namespace: default
spec: spec:
# Add fields here # Add fields here
image: chrislusf/seaweedfs:2.08 image: chrislusf/seaweedfs:2.09
volumeServerDiskCount: 1 volumeServerDiskCount: 1
master: master:
replicas: 3 replicas: 3
@ -17,8 +18,5 @@ spec:
replicas: 2 replicas: 2
config: | config: |
[leveldb2] [leveldb2]
# local on disk, mostly for simple single-machine setup, fairly scalable
# faster than previous leveldb, recommended.
enabled = true enabled = true
dir = "." # directory to store level db files dir = "/data/filerldb2"

View File

@ -2,6 +2,7 @@ package controllers
import ( import (
"context" "context"
"strings"
"time" "time"
appsv1 "k8s.io/api/apps/v1" appsv1 "k8s.io/api/apps/v1"
@ -35,7 +36,7 @@ func (r *SeaweedReconciler) ensureMaster(seaweedCR *seaweedv1.Seaweed) (done boo
return return
} }
if !*seaweedCR.Spec.Master.ConcurrentStart { if seaweedCR.Spec.Master.ConcurrentStart == nil || !*seaweedCR.Spec.Master.ConcurrentStart {
if done, result, err = r.waitForMasterStatefulSet(seaweedCR); done { if done, result, err = r.waitForMasterStatefulSet(seaweedCR); done {
return return
} }
@ -62,10 +63,11 @@ func (r *SeaweedReconciler) waitForMasterStatefulSet(seaweedCR *seaweedv1.Seawee
for _, pod := range podList.Items { for _, pod := range podList.Items {
if pod.Status.Phase == corev1.PodRunning { if pod.Status.Phase == corev1.PodRunning {
for _, containerStatus := range pod.Status.ContainerStatuses { for _, containerStatus := range pod.Status.ContainerStatuses {
if containerStatus.Image == seaweedCR.Spec.Image { if strings.Contains(containerStatus.Image, seaweedCR.Spec.Image) {
runningCounter++ runningCounter++
break break
} }
log.Info("pod", "name", pod.Name, "containerStatus", containerStatus)
} }
} else { } else {
log.Info("pod", "name", pod.Name, "status", pod.Status) log.Info("pod", "name", pod.Name, "status", pod.Status)