Skip to content

Commit

Permalink
Fix SingleStore SatafulSet Name
Browse files Browse the repository at this point in the history
Signed-off-by: ashraful <[email protected]>
  • Loading branch information
AshrafulHaqueToni committed Feb 8, 2024
1 parent aa33c6e commit 7037cb1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apis/kubedb/v1alpha2/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ const (
DatabasePodMaster = "Master"
DatabasePodAggregator = "Aggregator"
DatabasePodLeaf = "Leaf"
StatefulSetTypeMasterAggregator = "master-aggregator"
StatefulSetTypeAggregator = "aggregator"
StatefulSetTypeLeaf = "leaf"
SinglestoreDatabaseHealth = "singlestore_health"
SinglestoreTableHealth = "singlestore_health_table"
Expand Down
12 changes: 10 additions & 2 deletions apis/kubedb/v1alpha2/singlestore_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,19 @@ func (s *Singlestore) PVCName(alias string) string {
}

func (s *Singlestore) AggregatorStatefulSet() string {
return metautil.NameWithSuffix(s.OffshootName(), StatefulSetTypeMasterAggregator)
sts := s.OffshootName()
if s.Spec.Topology.Aggregator.Suffix != "" {
sts = metautil.NameWithSuffix(sts, s.Spec.Topology.Aggregator.Suffix)
}
return metautil.NameWithSuffix(sts, StatefulSetTypeAggregator)
}

func (s *Singlestore) LeafStatefulSet() string {
return metautil.NameWithSuffix(s.OffshootName(), StatefulSetTypeLeaf)
sts := s.OffshootName()
if s.Spec.Topology.Leaf.Suffix != "" {
sts = metautil.NameWithSuffix(sts, s.Spec.Topology.Leaf.Suffix)
}
return metautil.NameWithSuffix(sts, StatefulSetTypeLeaf)
}

func (s *Singlestore) PodLabels(extraLabels ...map[string]string) map[string]string {
Expand Down

0 comments on commit 7037cb1

Please sign in to comment.