Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit dbac98c

Browse files
authored
Fix incorrectly setting cluster ready to true (#172)
1 parent 881e574 commit dbac98c

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

pkg/controllers/cluster/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ func (m *MySQLController) updateClusterStatus(cluster *v1alpha1.Cluster, ss *app
470470
if condition == nil {
471471
condition = &v1alpha1.ClusterCondition{Type: v1alpha1.ClusterReady}
472472
}
473-
if ss.Status.ReadyReplicas == ss.Status.Replicas {
473+
if ss.Status.ReadyReplicas == ss.Status.Replicas && ss.Status.ReadyReplicas == cluster.Spec.Members {
474474
condition.Status = corev1.ConditionTrue
475475
} else {
476476
condition.Status = corev1.ConditionFalse

test/e2e/framework/cluster.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ func (j *ClusterTestJig) waitForConditionOrFail(namespace, name string, timeout
136136
func (j *ClusterTestJig) WaitForClusterReadyOrFail(namespace, name string, timeout time.Duration) *v1alpha1.Cluster {
137137
Logf("Waiting up to %v for Cluster \"%s/%s\" to be ready", timeout, namespace, name)
138138
cluster := j.waitForConditionOrFail(namespace, name, timeout, "have all nodes ready", func(cluster *v1alpha1.Cluster) bool {
139-
Logf("Cluster conditions: %#v", cluster.Status.Conditions)
140139
return clusterutil.IsClusterReady(cluster)
141140
})
142141
return cluster

0 commit comments

Comments
 (0)