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

Fix incorrectly setting cluster ready to true #172

Merged
merged 1 commit into from
Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/controllers/cluster/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ func (m *MySQLController) updateClusterStatus(cluster *v1alpha1.Cluster, ss *app
if condition == nil {
condition = &v1alpha1.ClusterCondition{Type: v1alpha1.ClusterReady}
}
if ss.Status.ReadyReplicas == ss.Status.Replicas {
if ss.Status.ReadyReplicas == ss.Status.Replicas && ss.Status.ReadyReplicas == cluster.Spec.Members {
condition.Status = corev1.ConditionTrue
} else {
condition.Status = corev1.ConditionFalse
Expand Down
1 change: 0 additions & 1 deletion test/e2e/framework/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func (j *ClusterTestJig) waitForConditionOrFail(namespace, name string, timeout
func (j *ClusterTestJig) WaitForClusterReadyOrFail(namespace, name string, timeout time.Duration) *v1alpha1.Cluster {
Logf("Waiting up to %v for Cluster \"%s/%s\" to be ready", timeout, namespace, name)
cluster := j.waitForConditionOrFail(namespace, name, timeout, "have all nodes ready", func(cluster *v1alpha1.Cluster) bool {
Logf("Cluster conditions: %#v", cluster.Status.Conditions)
return clusterutil.IsClusterReady(cluster)
})
return cluster
Expand Down