Skip to content

Commit

Permalink
Fix replica count for arbiter & hidden node (#1106)
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <arnob@appscode.com>
  • Loading branch information
ArnobKumarSaha authored Jan 12, 2024
1 parent 4e194f0 commit 2fd99ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apis/kubedb/v1alpha2/mongodb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,12 @@ func (m *MongoDB) ReplicasAreReady(lister appslister.StatefulSetLister) (bool, s
if m.Spec.ShardTopology != nil {
expectedItems = 2 + int(m.Spec.ShardTopology.Shard.Shards)
}
if m.Spec.Arbiter != nil {
expectedItems++
}
if m.Spec.Hidden != nil {
expectedItems++
}
return checkReplicas(lister.StatefulSets(m.Namespace), labels.SelectorFromSet(m.OffshootLabels()), expectedItems)
}

Expand Down

0 comments on commit 2fd99ee

Please sign in to comment.