From 0f08e7561fb6251a0a8a738629cde968873a9cd4 Mon Sep 17 00:00:00 2001 From: SK Ali Arman Date: Wed, 27 Nov 2024 13:13:21 +0600 Subject: [PATCH 1/3] Add ReplicationStrategy Default Value for MySQL Signed-off-by: SK Ali Arman --- apis/kubedb/v1/mysql_helpers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apis/kubedb/v1/mysql_helpers.go b/apis/kubedb/v1/mysql_helpers.go index a9af4b3c50..87c27aae7c 100644 --- a/apis/kubedb/v1/mysql_helpers.go +++ b/apis/kubedb/v1/mysql_helpers.go @@ -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" @@ -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() { From dd9c2f690f9fe7d18ae6cf23b22e4b31fc551619 Mon Sep 17 00:00:00 2001 From: SK Ali Arman Date: Fri, 29 Nov 2024 18:18:32 +0600 Subject: [PATCH 2/3] update deps Signed-off-by: SK Ali Arman --- go.mod | 2 +- go.sum | 4 ++-- vendor/modules.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 62c036dd9b..d947dfaf3c 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 654f35489c..017ffa4f8c 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/vendor/modules.txt b/vendor/modules.txt index 53c916e6a7..b9a2f8569d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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 From e97739d1180e6901eab7053a7da8c2eba7a0f1f4 Mon Sep 17 00:00:00 2001 From: SK Ali Arman Date: Wed, 4 Dec 2024 18:51:31 +0600 Subject: [PATCH 3/3] add md default strategy Signed-off-by: SK Ali Arman --- apis/kubedb/v1/mariadb_helpers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apis/kubedb/v1/mariadb_helpers.go b/apis/kubedb/v1/mariadb_helpers.go index 54b6b64bad..a4138500e0 100644 --- a/apis/kubedb/v1/mariadb_helpers.go +++ b/apis/kubedb/v1/mariadb_helpers.go @@ -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" @@ -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()