Skip to content

Commit

Permalink
refactor
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 23, 2025
1 parent 936d096 commit 5ea9fb6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apis/catalog/v1alpha1/mariadb_version_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ func (m MariaDBVersion) ValidateSpecs() error {
if m.Spec.Version == "" ||
m.Spec.DB.Image == "" ||
m.Spec.Exporter.Image == "" ||
m.Spec.Maxscale.Image == "" ||
m.Spec.InitContainer.Image == "" ||
m.Spec.Coordinator.Image == "" {
return fmt.Errorf(`atleast one of the following specs is not set for mariadbversion "%v":
spec.version,
spec.db.image,
spec.exporter.image,
spec.maxscale.image,
spec.initContainer.image,
spec.coordinator.image.`, m.Name)
}
Expand Down
5 changes: 5 additions & 0 deletions apis/kubedb/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,15 @@ const (
MariaDBMetricsExporterTLSVolumeName = "metrics-exporter-config"
MariaDBMetricsExporterConfigPath = "/etc/mysql/config/exporter"
MariaDBDataVolumeName = "data"
DatabasePodPrimaryComponent = "Primary"
DatabasePodMasterComponent = "Master"
DatabasePodSlaveComponent = "Slave"

// Maxscale
MaxscaleCommonName = "maxscale"
MaxscaleContainerName = "maxscale"
MaxscaleInitContainerName = "maxscale-init"
MaxscaleServerName = "server"

// =========================== SingleStore Constants ============================
SinglestoreDatabasePortName = "db"
Expand Down
2 changes: 1 addition & 1 deletion apis/kubedb/v1/mariadb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (m MariaDB) OffshootName() string {
}

func (m MariaDB) OffshootMaxscaleName() string {
return meta_util.NameWithSuffix(m.Name, "maxscale")
return meta_util.NameWithSuffix(m.Name, kubedb.MaxscaleCommonName)
}

func (m MariaDB) OffshootSelectors() map[string]string {
Expand Down

0 comments on commit 5ea9fb6

Please sign in to comment.