Skip to content

Commit

Permalink
update version
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 22, 2025
1 parent 4131cc7 commit 5564550
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 2 deletions.
7 changes: 7 additions & 0 deletions apis/catalog/v1alpha1/mariadb_version_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ type MariaDBVersionSpec struct {
Version string `json:"version"`
// Database Image
DB MariaDBVersionDatabase `json:"db"`
// Maxscale Image
Maxscale MariaDBVersionMaxscale `json:"maxscale"`
// Exporter Image
Exporter MariaDBVersionExporter `json:"exporter"`
// Coordinator Image
Expand Down Expand Up @@ -87,6 +89,11 @@ type MariaDBVersionDatabase struct {
Image string `json:"image"`
}

// MariaDBVersionMaxscale is the mariadb maxscale image
type MariaDBVersionMaxscale struct {
Image string `json:"image"`
}

// MariaDBVersionExporter is the image for the MariaDB exporter
type MariaDBVersionExporter struct {
Image string `json:"image"`
Expand Down
33 changes: 31 additions & 2 deletions apis/catalog/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions apis/catalog/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions apis/kubedb/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ const (
MariaDBMetricsExporterConfigPath = "/etc/mysql/config/exporter"
MariaDBDataVolumeName = "data"

// Maxscale
MaxscaleContainerName = "maxscale"

// =========================== SingleStore Constants ============================
SinglestoreDatabasePortName = "db"
SinglestorePrimaryServicePortName = "primary"
Expand Down
28 changes: 28 additions & 0 deletions apis/kubedb/v1/mariadb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func (m MariaDB) OffshootName() string {
return m.Name
}

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

func (m MariaDB) OffshootSelectors() map[string]string {
return map[string]string{
meta_util.NameLabelKey: m.ResourceFQN(),
Expand All @@ -66,18 +70,38 @@ func (m MariaDB) OffshootSelectors() map[string]string {
}
}

func (m MariaDB) OffshootMaxscaleSelectors() map[string]string {
return map[string]string{
meta_util.NameLabelKey: m.ResourceFQN(),
meta_util.InstanceLabelKey: m.OffshootMaxscaleName(),
meta_util.ManagedByLabelKey: kubedb.GroupName,
}
}

func (m MariaDB) OffshootLabels() map[string]string {
return m.offshootLabels(m.OffshootSelectors(), nil)
}

func (m MariaDB) OffshootMaxscaleLabels() map[string]string {
return m.offshootLabels(m.OffshootMaxscaleSelectors(), nil)
}

func (m MariaDB) PodLabels() map[string]string {
return m.offshootLabels(m.OffshootSelectors(), m.Spec.PodTemplate.Labels)
}

func (m MariaDB) MaxscalePodLabels() map[string]string {
return m.offshootLabels(m.OffshootMaxscaleSelectors(), m.Spec.PodTemplate.Labels)
}

func (m MariaDB) PodControllerLabels() map[string]string {
return m.offshootLabels(m.OffshootSelectors(), m.Spec.PodTemplate.Controller.Labels)
}

func (m MariaDB) MaxscalePodControllerLabels() map[string]string {
return m.offshootLabels(m.OffshootMaxscaleSelectors(), m.Spec.PodTemplate.Controller.Labels)
}

func (m MariaDB) SidekickLabels(skName string) map[string]string {
return meta_util.OverwriteKeys(nil, kubedb.CommonSidekickLabels(), map[string]string{
meta_util.InstanceLabelKey: skName,
Expand Down Expand Up @@ -140,6 +164,10 @@ func (m MariaDB) GoverningServiceName() string {
return meta_util.NameWithSuffix(m.ServiceName(), "pods")
}

func (m MariaDB) MaxscaleGoverningServiceName() string {
return meta_util.NameWithSuffix(m.OffshootMaxscaleName(), "pods")
}

func (m MariaDB) PeerName(idx int) string {
return fmt.Sprintf("%s-%d.%s.%s", m.OffshootName(), idx, m.GoverningServiceName(), m.Namespace)
}
Expand Down
8 changes: 8 additions & 0 deletions crds/catalog.kubedb.com_mariadbversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ spec:
required:
- image
type: object
maxscale:
properties:
image:
type: string
required:
- image
type: object
podSecurityPolicies:
properties:
databasePolicyName:
Expand Down Expand Up @@ -233,6 +240,7 @@ spec:
- db
- exporter
- initContainer
- maxscale
- podSecurityPolicies
- version
type: object
Expand Down

0 comments on commit 5564550

Please sign in to comment.