Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReplicationStrategy Default Value for MySQL #1356

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apis/kubedb/v1/mariadb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/utils/ptr"
kmapi "kmodules.xyz/client-go/api/v1"
"kmodules.xyz/client-go/apiextensions"
core_util "kmodules.xyz/client-go/core/v1"
Expand Down Expand Up @@ -221,7 +222,9 @@ func (m *MariaDB) SetDefaults(mdVersion *v1alpha1.MariaDBVersion) {
if m.Spec.PodTemplate.Spec.ServiceAccountName == "" {
m.Spec.PodTemplate.Spec.ServiceAccountName = m.OffshootName()
}

if m.Spec.Init != nil && m.Spec.Init.Archiver != nil && m.Spec.Init.Archiver.ReplicationStrategy == nil {
m.Spec.Init.Archiver.ReplicationStrategy = ptr.To(ReplicationStrategyNone)
}
m.setDefaultContainerSecurityContext(mdVersion, &m.Spec.PodTemplate)
m.setDefaultContainerResourceLimits(&m.Spec.PodTemplate)
m.SetTLSDefaults()
Expand Down
4 changes: 4 additions & 0 deletions apis/kubedb/v1/mysql_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/utils/ptr"
kmapi "kmodules.xyz/client-go/api/v1"
"kmodules.xyz/client-go/apiextensions"
core_util "kmodules.xyz/client-go/core/v1"
Expand Down Expand Up @@ -316,6 +317,9 @@ func (m *MySQL) SetDefaults(myVersion *v1alpha1.MySQLVersion) {
m.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = myVersion.Spec.SecurityContext.RunAsUser
}
}
if m.Spec.Init != nil && m.Spec.Init.Archiver != nil && m.Spec.Init.Archiver.ReplicationStrategy == nil {
m.Spec.Init.Archiver.ReplicationStrategy = ptr.To(ReplicationStrategyNone)
}
}

func (m *MySQL) SetTLSDefaults() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ require (
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.bytebuilders.dev/license-proxyserver v0.0.18 // indirect
go.bytebuilders.dev/license-proxyserver v0.0.19-0.20241022124046-544efbfc2bc4 // indirect
go.bytebuilders.dev/license-verifier v0.14.3 // indirect
go.bytebuilders.dev/license-verifier/kubernetes v0.14.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.14 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
go.bytebuilders.dev/audit v0.0.38 h1:4DEYVfBNeAfI9rctVWmpDOvEExh3gIuPsXVAg4Z3FWA=
go.bytebuilders.dev/audit v0.0.38/go.mod h1:6RC3gMMFpAzTzGJuJg8Ghgvebde4vvXkmDtUo11ypQw=
go.bytebuilders.dev/license-proxyserver v0.0.18 h1:xBEw3qJoskrgJrzVrLKfBIoC7bQIARUlNwBIpLkPXaw=
go.bytebuilders.dev/license-proxyserver v0.0.18/go.mod h1:7wLFkvqfHwmB6MHcdTHB72M8+b63jApS59efrqZlY1E=
go.bytebuilders.dev/license-proxyserver v0.0.19-0.20241022124046-544efbfc2bc4 h1:B5OO9DFYMmFUBPyo0xFFQmn/AEK+GNXWDMPYXpjJlAg=
go.bytebuilders.dev/license-proxyserver v0.0.19-0.20241022124046-544efbfc2bc4/go.mod h1:7wLFkvqfHwmB6MHcdTHB72M8+b63jApS59efrqZlY1E=
go.bytebuilders.dev/license-verifier v0.14.3 h1:5BTwmFEgCjSlAs2Nzh3/7+u//VoF93xjqywrJiqmZsg=
go.bytebuilders.dev/license-verifier v0.14.3/go.mod h1:bNNaVbry3TZbu54pf57LkhjsFX94T6O62w0roiy1yiE=
go.bytebuilders.dev/license-verifier/kubernetes v0.14.3 h1:PlzARW7Dt/t8WHtuNOxnB7GLhgdq30smRMAPRfyrhh8=
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ github.com/zeebo/xxh3
## explicit; go 1.22.1
go.bytebuilders.dev/audit/api/v1
go.bytebuilders.dev/audit/lib
# go.bytebuilders.dev/license-proxyserver v0.0.18
# go.bytebuilders.dev/license-proxyserver v0.0.19-0.20241022124046-544efbfc2bc4
## explicit; go 1.22.0
go.bytebuilders.dev/license-proxyserver/apis/proxyserver
go.bytebuilders.dev/license-proxyserver/apis/proxyserver/v1alpha1
Expand Down