Skip to content

Commit

Permalink
add helper func
Browse files Browse the repository at this point in the history
Signed-off-by: SK Ali Arman <[email protected]>
  • Loading branch information
sheikh-arman committed Jan 14, 2025
1 parent ac9c7d1 commit 4131cc7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apis/kubedb/v1/mariadb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@ func (m MariaDB) IsCluster() bool {
return pointer.Int32(m.Spec.Replicas) > 1
}

func (m MariaDB) IsGaleraCluster() bool {
return m.Spec.Topology != nil &&
m.Spec.Topology.Mode != nil &&
*m.Spec.Topology.Mode == MariaDBModeGaleraCluster
}

func (m MariaDB) IsMariaDBReplication() bool {
return m.Spec.Topology != nil &&
m.Spec.Topology.Mode != nil &&
*m.Spec.Topology.Mode == MariaDBModeReplication
}

func (m MariaDB) GoverningServiceName() string {
return meta_util.NameWithSuffix(m.ServiceName(), "pods")
}
Expand Down

0 comments on commit 4131cc7

Please sign in to comment.