Skip to content

Commit

Permalink
Fix mysql innodb podtemplate conversion
Browse files Browse the repository at this point in the history
Signed-off-by: souravbiswassanto <[email protected]>
  • Loading branch information
souravbiswassanto committed Jul 5, 2024
1 parent 77dc0eb commit f8d22a3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
15 changes: 15 additions & 0 deletions apis/kubedb/v1alpha2/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,21 @@ func Convert_v1_PostgresSpec_To_v1alpha2_PostgresSpec(in *v1.PostgresSpec, out *
return nil
}

func Convert_v1alpha2_MySQLRouterSpec_To_v1_MySQLRouterSpec(in *MySQLRouterSpec, out *v1.MySQLRouterSpec, s conversion.Scope) error {
out.Replicas = (*int32)(unsafe.Pointer(in.Replicas))
if in.PodTemplate != nil {
in, out := &in.PodTemplate, &out.PodTemplate
*out = new(ofstv2.PodTemplateSpec)
if err := Convert_v1_PodTemplateSpec_To_v2_PodTemplateSpec(*in, *out, s); err != nil {
return err
}
(*out).Spec.Containers[0].Name = kubedb.MySQLRouterContainerName
} else {
out.PodTemplate = nil
}
return nil
}

func Convert_v1alpha2_MySQLSpec_To_v1_MySQLSpec(in *MySQLSpec, out *v1.MySQLSpec, s conversion.Scope) error {
if err := Convert_v1alpha2_AutoOpsSpec_To_v1_AutoOpsSpec(&in.AutoOps, &out.AutoOps, s); err != nil {
return err
Expand Down
15 changes: 5 additions & 10 deletions apis/kubedb/v1alpha2/zz_generated.conversion.go

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

0 comments on commit f8d22a3

Please sign in to comment.