From 0ae8283116c601eae289ee6b76c4374936b5062a Mon Sep 17 00:00:00 2001 From: 1gtm <1gtm@appscode.com> Date: Wed, 25 Feb 2026 22:58:56 +0000 Subject: [PATCH] Prepare for release v0.61.0 ProductLine: KubeDB Release: v2026.2.27 Release-tracker: https://github.com/kubedb/CHANGELOG/pull/127 Signed-off-by: 1gtm <1gtm@appscode.com> --- go.mod | 10 +- go.sum | 20 +- .../client-go/api/v1/certificates.go | 2 +- .../kmodules.xyz/client-go/api/v1/cluster.go | 43 +- .../client-go/api/v1/generated.pb.go | 419 ++++++++++++------ .../client-go/api/v1/generated.proto | 2 +- .../kmodules.xyz/client-go/api/v1/object.go | 8 +- .../client-go/api/v1/zz_generated.deepcopy.go | 6 +- .../client-go/conditions/getter.go | 18 +- .../kmodules.xyz/client-go/conditions/meta.go | 7 +- .../client-go/conditions/patch.go | 8 +- .../client-go/core/v1/kubernetes.go | 14 +- .../kmodules.xyz/client-go/meta/conditions.go | 7 +- .../kmodules.xyz/client-go/meta/encoding.go | 2 +- vendor/kmodules.xyz/client-go/meta/lib.go | 19 +- .../client-go/tools/healthchecker/const.go | 45 ++ .../tools/healthchecker/health_card.go | 78 ++++ .../tools/healthchecker/health_checker.go | 128 ++++++ .../apis/node/v1alpha1/openapi_generated.go | 5 +- .../identity.k8s.appscode.com_siteinfos.yaml | 15 + .../apis/archiver/v1alpha1/const.go | 6 + .../apis/archiver/v1alpha1/helpers.go | 28 ++ .../archiver/v1alpha1/openapi_generated.go | 5 +- .../autoscaling/v1alpha1/openapi_generated.go | 5 +- .../catalog/v1alpha1/db2_version_types.go | 3 +- .../catalog/v1alpha1/hanadb_version_types.go | 12 +- .../catalog/v1alpha1/mariadb_version_types.go | 2 +- .../v1alpha1/mssqlserver_version_types.go | 3 +- .../catalog/v1alpha1/mysql_version_types.go | 3 +- .../catalog/v1alpha1/openapi_generated.go | 71 ++- .../catalog/v1alpha1/oracle_version_types.go | 2 +- .../v1alpha1/perconaxtradb_version_types.go | 2 +- .../v1alpha1/postgres_version_types.go | 5 +- .../catalog/v1alpha1/redis_version_types.go | 2 +- .../v1alpha1/singlestore_version_types.go | 4 +- .../v1alpha1/zookeeper_version_types.go | 2 +- .../catalog/v1alpha1/zz_generated.deepcopy.go | 17 + .../apis/config/v1alpha1/openapi_generated.go | 5 +- .../v1alpha1/openapi_generated.go | 5 +- .../apis/gitops/v1alpha1/openapi_generated.go | 5 +- .../apis/kafka/v1alpha1/openapi_generated.go | 5 +- .../apimachinery/apis/kubedb/constants.go | 11 +- .../apis/kubedb/v1/openapi_generated.go | 5 +- .../apis/kubedb/v1/postgres_helpers.go | 46 +- .../apis/kubedb/v1alpha1/openapi_generated.go | 5 +- .../apis/kubedb/v1alpha2/hanadb_helpers.go | 253 +++++++++++ .../apis/kubedb/v1alpha2/hanadb_types.go | 36 ++ .../apis/kubedb/v1alpha2/neo4j_helpers.go | 2 +- .../apis/kubedb/v1alpha2/openapi_generated.go | 153 ++++++- .../kubedb/v1alpha2/zz_generated.deepcopy.go | 53 +++ .../migrator/v1alpha1/openapi_generated.go | 5 +- .../apis/ops/v1alpha1/constant.go | 1 + .../apis/ops/v1alpha1/neo4j_ops_types.go | 22 +- .../apis/ops/v1alpha1/neo4j_ops_types_enum.go | 7 +- .../apis/ops/v1alpha1/openapi_generated.go | 83 +++- .../ops/v1alpha1/zz_generated.deepcopy.go | 22 + .../postgres/v1alpha1/openapi_generated.go | 5 +- .../apis/schema/v1alpha1/openapi_generated.go | 5 +- .../apis/ui/v1alpha1/openapi_generated.go | 5 +- .../crds/catalog.kubedb.com_db2versions.yaml | 1 + .../catalog.kubedb.com_hanadbversions.yaml | 10 +- .../catalog.kubedb.com_mariadbversions.yaml | 1 + ...atalog.kubedb.com_mssqlserverversions.yaml | 1 + .../catalog.kubedb.com_mysqlversions.yaml | 1 + .../catalog.kubedb.com_oracleversions.yaml | 1 + ...alog.kubedb.com_perconaxtradbversions.yaml | 1 + .../catalog.kubedb.com_postgresversions.yaml | 2 + .../catalog.kubedb.com_redisversions.yaml | 1 + ...atalog.kubedb.com_singlestoreversions.yaml | 1 + .../catalog.kubedb.com_zookeeperversions.yaml | 1 + .../apimachinery/crds/kubedb.com_hanadbs.yaml | 18 + .../crds/ops.kubedb.com_neo4jopsrequests.yaml | 157 +++++++ .../pkg/utils/raft/client_helpers.go | 121 +++++ .../pkg/utils/raft/raft_helpers.go | 271 +++++++++++ .../apimachinery/pkg/utils/resolve.go | 79 ++++ .../apimachinery/pkg/utils/updater.go | 239 ++++++++++ .../apimachinery/apis/helpers.go | 5 +- vendor/modules.txt | 13 +- 78 files changed, 2361 insertions(+), 330 deletions(-) create mode 100644 vendor/kmodules.xyz/client-go/tools/healthchecker/const.go create mode 100644 vendor/kmodules.xyz/client-go/tools/healthchecker/health_card.go create mode 100644 vendor/kmodules.xyz/client-go/tools/healthchecker/health_checker.go create mode 100644 vendor/kubedb.dev/apimachinery/pkg/utils/raft/client_helpers.go create mode 100644 vendor/kubedb.dev/apimachinery/pkg/utils/raft/raft_helpers.go create mode 100644 vendor/kubedb.dev/apimachinery/pkg/utils/resolve.go create mode 100644 vendor/kubedb.dev/apimachinery/pkg/utils/updater.go diff --git a/go.mod b/go.mod index aa96826de..16105dd87 100644 --- a/go.mod +++ b/go.mod @@ -24,11 +24,11 @@ require ( k8s.io/klog/v2 v2.130.1 k8s.io/kubectl v0.32.3 kmodules.xyz/cert-manager-util v0.29.0 - kmodules.xyz/client-go v0.34.2 + kmodules.xyz/client-go v0.34.3 kmodules.xyz/custom-resources v0.34.0 kmodules.xyz/monitoring-agent-api v0.34.1 - kubedb.dev/apimachinery v0.61.0-rc.1 - kubedb.dev/db-client-go v0.16.0-rc.1 + kubedb.dev/apimachinery v0.61.0 + kubedb.dev/db-client-go v0.16.0 kubeops.dev/petset v0.0.15 sigs.k8s.io/controller-runtime v0.22.4 sigs.k8s.io/yaml v1.6.0 @@ -169,11 +169,11 @@ require ( kmodules.xyz/objectstore-api v0.34.0 // indirect kmodules.xyz/offshoot-api v0.34.0 // indirect kmodules.xyz/prober v0.34.0 // indirect - kmodules.xyz/resource-metadata v0.42.1 // indirect + kmodules.xyz/resource-metadata v0.42.4 // indirect kubeops.dev/csi-driver-cacerts v0.5.0 // indirect kubeops.dev/operator-shard-manager v0.0.5 // indirect kubeops.dev/sidekick v0.0.12 // indirect - kubestash.dev/apimachinery v0.24.0-rc.0 // indirect + kubestash.dev/apimachinery v0.24.0 // indirect open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6 // indirect sigs.k8s.io/gateway-api v1.4.0 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect diff --git a/go.sum b/go.sum index 2ff40e125..7326cd9c3 100644 --- a/go.sum +++ b/go.sum @@ -738,8 +738,8 @@ kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk= kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80= kmodules.xyz/cert-manager-util v0.29.0 h1:HjEaEsv66xeMKiI8LwfTRls0z9V9L0qEvPBdOcX/CsI= kmodules.xyz/cert-manager-util v0.29.0/go.mod h1:0YuaPwp+P3Pw7Spxf6eDhOCMDDNXfNV2xIuxIexT1QU= -kmodules.xyz/client-go v0.34.2 h1:2Cec+nyfj9kfbR+5KPK3AksxN6h4jSjhn/tw+Dhqggo= -kmodules.xyz/client-go v0.34.2/go.mod h1:kQRuGMxhb+B9rVdcfBzjK+PV7oBDo+SaDiQ66u1QG+4= +kmodules.xyz/client-go v0.34.3 h1:2K2Tjwwy62QOpgIpuRB0STDAt2e7omkKt06oC8YV+/U= +kmodules.xyz/client-go v0.34.3/go.mod h1:myCt7AfRao4PBdUtKXu01xxbqqmLZ5U8fW0LQDaifhQ= kmodules.xyz/custom-resources v0.34.0 h1:ljkIYzIq0A3Awj87kkpuYqS9aifuyR3Hr9q2OVKoojM= kmodules.xyz/custom-resources v0.34.0/go.mod h1:pcA/n/CnrycjKCRNtU9Z+l5svhzFncLY2Kn9pqeXDVs= kmodules.xyz/monitoring-agent-api v0.34.1 h1:0ANZgff50xF9D9cFng1NBVmSeLwiYPsZKiFLcxAY9bQ= @@ -750,12 +750,12 @@ kmodules.xyz/offshoot-api v0.34.0 h1:HnOOp8FrCjTWjtNApRDo6Ahe79tOlLrJmyye4xxO4Kk kmodules.xyz/offshoot-api v0.34.0/go.mod h1:F+B59yYw4CZJ4uD4xu6C+mMLzIXUtuH7E+SbDICl9jE= kmodules.xyz/prober v0.34.0 h1:ElZkZYCjLaytAA0M8EH42To7i9gh1IIX+d0qfaIohys= kmodules.xyz/prober v0.34.0/go.mod h1:rsu/fxxfNxY70GDbH6Ju8G66459hi7AhWSSBoiIp8ic= -kmodules.xyz/resource-metadata v0.42.1 h1:RxAi354cKOeCVLoZI+WjR+tooU4lEq/axIafm1SYa20= -kmodules.xyz/resource-metadata v0.42.1/go.mod h1:xntcQko2QLbLEHwGE4TQ7I/80fcBQzcexbep97Akstk= -kubedb.dev/apimachinery v0.61.0-rc.1 h1:PKF3R0wFe8PwVPaDDBxNh49KAcw3uQhpIoGS3cWnx9U= -kubedb.dev/apimachinery v0.61.0-rc.1/go.mod h1:PscykF7tqpp+MS9Q7P+lxceW4pUnkWKzNZg2fdMA4Jw= -kubedb.dev/db-client-go v0.16.0-rc.1 h1:ytfC5VJzvl08DaT7yL0/P72npWLujNfgT1gEMEPUaZY= -kubedb.dev/db-client-go v0.16.0-rc.1/go.mod h1:HLmeMqgc6vsSS2Fn6tM9U66IjoUv+pnXUBuzpBypWT0= +kmodules.xyz/resource-metadata v0.42.4 h1:nFVo+PKmwWdzVwk7U3VZuKBQj3tPo6fyY5BC7gE2OB8= +kmodules.xyz/resource-metadata v0.42.4/go.mod h1:++18wSB28Wrw3ZxnOd8o8IVg7oMyWPwaPfuLw21QnPc= +kubedb.dev/apimachinery v0.61.0 h1:gYI8RFr6W9k9+961fwoWz/6DVGmX0NwPXlTzPBYKxB4= +kubedb.dev/apimachinery v0.61.0/go.mod h1:LaumaEPYGkieolZcvmT75qqZxKbcN0mZ4xIuA85TZaY= +kubedb.dev/db-client-go v0.16.0 h1:mvlFoVQfyvzxegVHz07IXbzhTDdYOTz3zsm3PJZ//PE= +kubedb.dev/db-client-go v0.16.0/go.mod h1:W4tETd5ZYrVL5fFM0Kn2uF2wyLWMgllnMqfJADu3Gak= kubeops.dev/csi-driver-cacerts v0.5.0 h1:WaKfoIyh7rx9rNZ65wJ3GkzhECkOjxd9dcO0iEx3xKU= kubeops.dev/csi-driver-cacerts v0.5.0/go.mod h1:VNbwC3gTWfmdQCVxd8mkVx+n1+0F1lOA5X3usyZN1rk= kubeops.dev/operator-shard-manager v0.0.5 h1:i7VnyUfIa9u3RQhSTVWNsooXcgmrWWxJyI9gJ10onE8= @@ -764,8 +764,8 @@ kubeops.dev/petset v0.0.15 h1:iwTRFAp0RNw0A87sw2c97UZ6WIA9H/nhJBpDhXLa7fk= kubeops.dev/petset v0.0.15/go.mod h1:sw96WiXfzhpmKpXj4a5AdmEHs0Bx4QMhf+iW15zY4Gg= kubeops.dev/sidekick v0.0.12 h1:pmUjQLZDKxgREiM6z0PogLR1aDbgvkE9jRjbxG6dEt0= kubeops.dev/sidekick v0.0.12/go.mod h1:RU7QH3E8DOLw15rBYlOOJSyczuwAnVVtYyZjJb00UB8= -kubestash.dev/apimachinery v0.24.0-rc.0 h1:JRVGCjDvJo0qEQLpuP6gNKmFEgBbp+e20qUsnhYNA+c= -kubestash.dev/apimachinery v0.24.0-rc.0/go.mod h1:Y+/8u+3kPWBuaVchmUn4/AlaGW0nLUZh57JWwvNiDlE= +kubestash.dev/apimachinery v0.24.0 h1:NLPLHAyN/TpPP4kA9NMQT1Lg/CTlCzBqGP/aybVdlN8= +kubestash.dev/apimachinery v0.24.0/go.mod h1:OV3Iq2tVRAW7k7LsukL+R33I5H/gfT2YddBdXo8DTjI= open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6 h1:mfcUKaSOYVDLzuontUOcasesbU9whNnvgrA0qf9trKs= open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6/go.mod h1:YcmA6SpGEekIMxdoeVIIyOaBhMA6ImWRLXP4g8n8T+4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/kmodules.xyz/client-go/api/v1/certificates.go b/vendor/kmodules.xyz/client-go/api/v1/certificates.go index a6ca4f774..530748f03 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/certificates.go +++ b/vendor/kmodules.xyz/client-go/api/v1/certificates.go @@ -261,7 +261,7 @@ func RemoveCertificate(certificates []CertificateSpec, alias string) []Certifica type stringSetMerger struct{} func (t stringSetMerger) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { - if typ == reflect.TypeOf([]string{}) { + if typ == reflect.TypeFor[[]string]() { return func(dst, src reflect.Value) error { if dst.CanSet() { if dst.Len() <= 1 && src.Len() == 0 { diff --git a/vendor/kmodules.xyz/client-go/api/v1/cluster.go b/vendor/kmodules.xyz/client-go/api/v1/cluster.go index 3bafb8212..68fe02110 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/cluster.go +++ b/vendor/kmodules.xyz/client-go/api/v1/cluster.go @@ -21,6 +21,7 @@ import ( "crypto/hmac" "crypto/sha256" "encoding/base64" + "encoding/json" "fmt" ) @@ -143,7 +144,43 @@ type ClusterClaimInfo struct { } type ClusterClaimFeatures struct { - EnabledFeatures []string `json:"enabledFeatures,omitempty" protobuf:"bytes,1,rep,name=enabledFeatures"` - ExternallyManagedFeatures []string `json:"externallyManagedFeatures,omitempty" protobuf:"bytes,2,rep,name=externallyManagedFeatures"` - DisabledFeatures []string `json:"disabledFeatures,omitempty" protobuf:"bytes,3,rep,name=disabledFeatures"` + EnabledFeatures map[string]string `json:"enabledFeatures,omitempty" protobuf:"bytes,1,opt,name=enabledFeatures"` + ExternallyManagedFeatures []string `json:"externallyManagedFeatures,omitempty" protobuf:"bytes,2,opt,name=externallyManagedFeatures"` + DisabledFeatures []string `json:"disabledFeatures,omitempty" protobuf:"bytes,3,opt,name=disabledFeatures"` +} + +func (f *ClusterClaimFeatures) UnmarshalJSON(data []byte) error { + aux := &struct { + EnabledFeatures any `json:"enabledFeatures,omitempty"` + ExternallyManagedFeatures []string `json:"externallyManagedFeatures,omitempty"` + DisabledFeatures []string `json:"disabledFeatures,omitempty"` + }{} + + if err := json.Unmarshal(data, aux); err != nil { + return err + } + + f.EnabledFeatures = toStringMap(aux.EnabledFeatures) + f.ExternallyManagedFeatures = aux.ExternallyManagedFeatures + f.DisabledFeatures = aux.DisabledFeatures + return nil +} + +func toStringMap(v any) map[string]string { + result := make(map[string]string) + switch val := v.(type) { + case []any: + for _, item := range val { + if str, ok := item.(string); ok { + result[str] = "" + } + } + case map[string]any: + for k, item := range val { + if str, ok := item.(string); ok { + result[k] = str + } + } + } + return result } diff --git a/vendor/kmodules.xyz/client-go/api/v1/generated.pb.go b/vendor/kmodules.xyz/client-go/api/v1/generated.pb.go index 9f04f8cbb..b70728acd 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/generated.pb.go +++ b/vendor/kmodules.xyz/client-go/api/v1/generated.pb.go @@ -28,6 +28,7 @@ import ( strings "strings" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" v1 "k8s.io/api/core/v1" k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v11 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -660,6 +661,7 @@ func init() { proto.RegisterType((*CertificatePrivateKey)(nil), "kmodules.xyz.client_go.api.v1.CertificatePrivateKey") proto.RegisterType((*CertificateSpec)(nil), "kmodules.xyz.client_go.api.v1.CertificateSpec") proto.RegisterType((*ClusterClaimFeatures)(nil), "kmodules.xyz.client_go.api.v1.ClusterClaimFeatures") + proto.RegisterMapType((map[string]string)(nil), "kmodules.xyz.client_go.api.v1.ClusterClaimFeatures.EnabledFeaturesEntry") proto.RegisterType((*ClusterClaimInfo)(nil), "kmodules.xyz.client_go.api.v1.ClusterClaimInfo") proto.RegisterType((*ClusterInfo)(nil), "kmodules.xyz.client_go.api.v1.ClusterInfo") proto.RegisterType((*ClusterMetadata)(nil), "kmodules.xyz.client_go.api.v1.ClusterMetadata") @@ -685,138 +687,141 @@ func init() { } var fileDescriptor_af8e7a11c7a1ccd9 = []byte{ - // 2092 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4f, 0x6f, 0x1c, 0x49, - 0x15, 0x77, 0x67, 0xc6, 0xf1, 0xcc, 0x1b, 0x3b, 0x93, 0x54, 0x8c, 0x32, 0x09, 0x1b, 0x4f, 0xe8, - 0x88, 0x28, 0x81, 0x4d, 0x1b, 0x47, 0x09, 0x2c, 0x2b, 0x10, 0x78, 0x66, 0x9c, 0x64, 0x76, 0xed, - 0x78, 0xa8, 0x71, 0xd8, 0xd5, 0x2e, 0x62, 0x55, 0xee, 0x2e, 0x8f, 0x0b, 0xf7, 0x74, 0xb7, 0xaa, - 0xba, 0x67, 0xd7, 0x7b, 0x5a, 0x6e, 0x70, 0x5b, 0x6e, 0x1c, 0x37, 0x12, 0x1f, 0x01, 0x09, 0xf1, - 0x09, 0xc8, 0x31, 0x5c, 0xd0, 0x4a, 0xa0, 0x11, 0x19, 0xae, 0x88, 0x0b, 0x20, 0x81, 0x4f, 0xa8, - 0xaa, 0xab, 0xff, 0x4c, 0x7b, 0xbc, 0xf6, 0xc2, 0x72, 0x9b, 0x79, 0xef, 0xf7, 0x7e, 0xf5, 0xaa, - 0xea, 0xd5, 0xfb, 0xd3, 0x70, 0xf7, 0x60, 0xe8, 0x3b, 0x91, 0x4b, 0x85, 0xf5, 0xc1, 0xe1, 0x87, - 0xab, 0xb6, 0xcb, 0xa8, 0x17, 0xde, 0x1d,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0x21, 0xa4, 0x9f, 0x6a, 0x1c, 0xf3, 0x6c, 0x2a, 0xbb, 0xf2, 0xd4, - 0xcf, 0x5e, 0x22, 0xc4, 0x99, 0x5e, 0x4e, 0xc2, 0x22, 0xe4, 0x94, 0x86, 0xd9, 0x87, 0x97, 0xf3, - 0xd9, 0x24, 0xdc, 0x9f, 0x56, 0xe1, 0x22, 0x16, 0xad, 0x41, 0x2d, 0xf0, 0x45, 0x48, 0xdc, 0xb6, - 0xef, 0xa4, 0x1f, 0x8d, 0xd4, 0x77, 0xa0, 0x5e, 0x26, 0xc6, 0x79, 0x8c, 0x9c, 0x97, 0x04, 0xe5, - 0x8c, 0xb8, 0x4f, 0xa2, 0xe1, 0x2e, 0xe5, 0xba, 0xa1, 0x4d, 0x5f, 0x42, 0x3f, 0xa7, 0xc3, 0x53, - 0xc8, 0x56, 0xfb, 0xf9, 0xcb, 0x95, 0xb9, 0x17, 0x2f, 0x57, 0xe6, 0x3e, 0x7d, 0xb9, 0x32, 0xf7, - 0xd1, 0x64, 0xc5, 0x78, 0x3e, 0x59, 0x31, 0x5e, 0x4c, 0x56, 0x8c, 0x4f, 0x27, 0x2b, 0xc6, 0x9f, - 0x27, 0x2b, 0xc6, 0xc7, 0x7f, 0x59, 0x99, 0x7b, 0xe7, 0xfa, 0x67, 0x7e, 0x8b, 0xfe, 0x4f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x23, 0xdc, 0x56, 0x82, 0xab, 0x16, 0x00, 0x00, + // 2140 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0x1c, 0x49, + 0xf5, 0x77, 0x67, 0xc6, 0xf1, 0xcc, 0x1b, 0x3b, 0x4e, 0x2a, 0xfe, 0x2a, 0x93, 0x7c, 0x37, 0x1e, + 0xd3, 0x11, 0x51, 0x02, 0x9b, 0x36, 0x8e, 0x12, 0x08, 0x11, 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, 0x68, 0x1d, 0x50, 0xfb, 0x50, 0x35, 0x96, 0xbf, 0x30, 0xe0, 0x0a, 0xa7, + 0xc4, 0xf1, 0x3d, 0x77, 0x58, 0xd0, 0xe9, 0x04, 0xff, 0xf5, 0x53, 0x92, 0x1d, 0x9e, 0x6e, 0xdd, + 0x6c, 0x68, 0x3f, 0xae, 0x9c, 0x00, 0xc0, 0x27, 0xad, 0x8b, 0x1e, 0xc3, 0x25, 0x5d, 0xd8, 0xde, + 0xe2, 0x2c, 0xa4, 0x4a, 0xa1, 0x12, 0x5f, 0xa5, 0x79, 0x55, 0x93, 0x5e, 0xda, 0x28, 0x02, 0xf0, + 0x71, 0x1b, 0xf3, 0x1f, 0x06, 0x54, 0xdb, 0x7d, 0xd2, 0xa3, 0xaa, 0x86, 0xdc, 0x80, 0x59, 0x26, + 0xff, 0x14, 0x7b, 0x68, 0x85, 0xc0, 0xb1, 0x0e, 0xed, 0x42, 0xc5, 0x65, 0x1e, 0x25, 0x3d, 0x5d, + 0xce, 0x6b, 0x77, 0x6f, 0x9e, 0xb2, 0xff, 0xad, 0x18, 0x9e, 0xa5, 0x18, 0x2d, 0x10, 0x38, 0x65, + 0x92, 0xd5, 0x33, 0x88, 0x5c, 0xb7, 0xc5, 0xa9, 0x43, 0xbd, 0x90, 0x11, 0x57, 0xa8, 0x80, 0x3e, + 0xbd, 0x92, 0x74, 0x26, 0xad, 0xe2, 0x6a, 0x55, 0x10, 0xe2, 0x22, 0xb7, 0xf9, 0x33, 0x03, 0xe6, + 0xb4, 0x17, 0xe8, 0x29, 0xcc, 0xda, 0x07, 0x84, 0x79, 0xba, 0x67, 0xba, 0x7d, 0xca, 0x82, 0xf1, + 0x44, 0xa0, 0xaa, 0x56, 0x7a, 0x40, 0x2d, 0x69, 0x8f, 0x63, 0x1a, 0x64, 0x01, 0xd8, 0xbe, 0x17, + 0x12, 0x19, 0xeb, 0x49, 0xc7, 0xa3, 0xfa, 0xba, 0x56, 0x2a, 0xc5, 0x39,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71, 0x5b, + 0xbe, 0x93, 0x7e, 0xc7, 0x52, 0x9f, 0xa6, 0x3a, 0x99, 0x18, 0xe7, 0x31, 0x72, 0x5e, 0x12, 0x94, + 0x33, 0xe2, 0x3e, 0x8d, 0xfa, 0x7b, 0x94, 0xeb, 0x86, 0x36, 0x7d, 0x09, 0xdd, 0x9c, 0x0e, 0x4f, + 0x20, 0x9b, 0xad, 0x17, 0xaf, 0x96, 0x67, 0x5e, 0xbe, 0x5a, 0x9e, 0xf9, 0xf4, 0xd5, 0xf2, 0xcc, + 0x47, 0xe3, 0x65, 0xe3, 0xc5, 0x78, 0xd9, 0x78, 0x39, 0x5e, 0x36, 0x3e, 0x1d, 0x2f, 0x1b, 0x7f, + 0x1e, 0x2f, 0x1b, 0x1f, 0xff, 0x65, 0x79, 0xe6, 0x9d, 0xeb, 0x9f, 0xf9, 0x79, 0xfc, 0xdf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x1e, 0x81, 0x20, 0x02, 0x3e, 0x17, 0x00, 0x00, } func (m *CAPIClusterInfo) Marshal() (dAtA []byte, err error) { @@ -1053,10 +1058,25 @@ func (m *ClusterClaimFeatures) MarshalToSizedBuffer(dAtA []byte) (int, error) { } } if len(m.EnabledFeatures) > 0 { - for iNdEx := len(m.EnabledFeatures) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.EnabledFeatures[iNdEx]) - copy(dAtA[i:], m.EnabledFeatures[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.EnabledFeatures[iNdEx]))) + keysForEnabledFeatures := make([]string, 0, len(m.EnabledFeatures)) + for k := range m.EnabledFeatures { + keysForEnabledFeatures = append(keysForEnabledFeatures, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForEnabledFeatures) + for iNdEx := len(keysForEnabledFeatures) - 1; iNdEx >= 0; iNdEx-- { + v := m.EnabledFeatures[string(keysForEnabledFeatures[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForEnabledFeatures[iNdEx]) + copy(dAtA[i:], keysForEnabledFeatures[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForEnabledFeatures[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -2005,9 +2025,11 @@ func (m *ClusterClaimFeatures) Size() (n int) { var l int _ = l if len(m.EnabledFeatures) > 0 { - for _, s := range m.EnabledFeatures { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) + for k, v := range m.EnabledFeatures { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } if len(m.ExternallyManagedFeatures) > 0 { @@ -2421,8 +2443,18 @@ func (this *ClusterClaimFeatures) String() string { if this == nil { return "nil" } + keysForEnabledFeatures := make([]string, 0, len(this.EnabledFeatures)) + for k := range this.EnabledFeatures { + keysForEnabledFeatures = append(keysForEnabledFeatures, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForEnabledFeatures) + mapStringForEnabledFeatures := "map[string]string{" + for _, k := range keysForEnabledFeatures { + mapStringForEnabledFeatures += fmt.Sprintf("%v: %v,", k, this.EnabledFeatures[k]) + } + mapStringForEnabledFeatures += "}" s := strings.Join([]string{`&ClusterClaimFeatures{`, - `EnabledFeatures:` + fmt.Sprintf("%v", this.EnabledFeatures) + `,`, + `EnabledFeatures:` + mapStringForEnabledFeatures + `,`, `ExternallyManagedFeatures:` + fmt.Sprintf("%v", this.ExternallyManagedFeatures) + `,`, `DisabledFeatures:` + fmt.Sprintf("%v", this.DisabledFeatures) + `,`, `}`, @@ -3359,7 +3391,7 @@ func (m *ClusterClaimFeatures) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EnabledFeatures", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -3369,23 +3401,118 @@ func (m *ClusterClaimFeatures) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.EnabledFeatures = append(m.EnabledFeatures, string(dAtA[iNdEx:postIndex])) + if m.EnabledFeatures == nil { + m.EnabledFeatures = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.EnabledFeatures[mapkey] = mapvalue iNdEx = postIndex case 2: if wireType != 2 { diff --git a/vendor/kmodules.xyz/client-go/api/v1/generated.proto b/vendor/kmodules.xyz/client-go/api/v1/generated.proto index c3a8864e2..dc1b76e3d 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/generated.proto +++ b/vendor/kmodules.xyz/client-go/api/v1/generated.proto @@ -100,7 +100,7 @@ message CertificateSpec { } message ClusterClaimFeatures { - repeated string enabledFeatures = 1; + map enabledFeatures = 1; repeated string externallyManagedFeatures = 2; diff --git a/vendor/kmodules.xyz/client-go/api/v1/object.go b/vendor/kmodules.xyz/client-go/api/v1/object.go index 90e50df87..c582ae5f6 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/object.go +++ b/vendor/kmodules.xyz/client-go/api/v1/object.go @@ -115,8 +115,8 @@ func NewObjectID(obj client.Object) *ObjectID { func ParseObjectID(key OID) (*ObjectID, error) { var id ObjectID - chunks := strings.Split(string(key), ",") - for _, chunk := range chunks { + chunks := strings.SplitSeq(string(key), ",") + for chunk := range chunks { parts := strings.FieldsFunc(chunk, func(r rune) bool { return r == '=' || unicode.IsSpace(r) }) @@ -166,8 +166,8 @@ func ObjectIDMap(key OID) (map[string]any, error) { "name": "", } - chunks := strings.Split(string(key), ",") - for _, chunk := range chunks { + chunks := strings.SplitSeq(string(key), ",") + for chunk := range chunks { parts := strings.FieldsFunc(chunk, func(r rune) bool { return r == '=' || unicode.IsSpace(r) }) diff --git a/vendor/kmodules.xyz/client-go/api/v1/zz_generated.deepcopy.go b/vendor/kmodules.xyz/client-go/api/v1/zz_generated.deepcopy.go index 303ef0d24..cacb9e1ce 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/zz_generated.deepcopy.go +++ b/vendor/kmodules.xyz/client-go/api/v1/zz_generated.deepcopy.go @@ -124,8 +124,10 @@ func (in *ClusterClaimFeatures) DeepCopyInto(out *ClusterClaimFeatures) { *out = *in if in.EnabledFeatures != nil { in, out := &in.EnabledFeatures, &out.EnabledFeatures - *out = make([]string, len(*in)) - copy(*out, *in) + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } } if in.ExternallyManagedFeatures != nil { in, out := &in.ExternallyManagedFeatures, &out.ExternallyManagedFeatures diff --git a/vendor/kmodules.xyz/client-go/conditions/getter.go b/vendor/kmodules.xyz/client-go/conditions/getter.go index 4bfa177a6..81459559a 100644 --- a/vendor/kmodules.xyz/client-go/conditions/getter.go +++ b/vendor/kmodules.xyz/client-go/conditions/getter.go @@ -17,6 +17,8 @@ limitations under the License. package conditions import ( + "slices" + kmapi "kmodules.xyz/client-go/api/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -135,13 +137,7 @@ func summary(from Getter, options ...MergeOption) *kmapi.Condition { } if mergeOpt.conditionTypes != nil { - found := false - for _, t := range mergeOpt.conditionTypes { - if c.Type == t { - found = true - break - } - } + found := slices.Contains(mergeOpt.conditionTypes, c.Type) if !found { continue } @@ -157,13 +153,7 @@ func summary(from Getter, options ...MergeOption) *kmapi.Condition { // in scope are included in this subset or not. if mergeOpt.addStepCounterIfOnlyConditionTypes != nil { for _, c := range conditionsInScope { - found := false - for _, t := range mergeOpt.addStepCounterIfOnlyConditionTypes { - if c.Type == t { - found = true - break - } - } + found := slices.Contains(mergeOpt.addStepCounterIfOnlyConditionTypes, c.Type) if !found { mergeOpt.addStepCounter = false break diff --git a/vendor/kmodules.xyz/client-go/conditions/meta.go b/vendor/kmodules.xyz/client-go/conditions/meta.go index b363a5e91..ec6156678 100644 --- a/vendor/kmodules.xyz/client-go/conditions/meta.go +++ b/vendor/kmodules.xyz/client-go/conditions/meta.go @@ -18,6 +18,7 @@ package conditions import ( "fmt" + "slices" kmapi "kmodules.xyz/client-go/api/v1" @@ -170,10 +171,8 @@ func (s Status) String() string { // not a valid status. func StatusFromStringOrDie(text string) Status { s := Status(text) - for _, r := range Statuses { - if s == r { - return s - } + if slices.Contains(Statuses, s) { + return s } panic(fmt.Errorf("string has invalid status: %s", s)) } diff --git a/vendor/kmodules.xyz/client-go/conditions/patch.go b/vendor/kmodules.xyz/client-go/conditions/patch.go index 5b55e3920..2e50a4e91 100644 --- a/vendor/kmodules.xyz/client-go/conditions/patch.go +++ b/vendor/kmodules.xyz/client-go/conditions/patch.go @@ -19,6 +19,7 @@ package conditions import ( "fmt" "reflect" + "slices" kmapi "kmodules.xyz/client-go/api/v1" @@ -87,12 +88,7 @@ type applyOptions struct { } func (o *applyOptions) isOwnedCondition(t kmapi.ConditionType) bool { - for _, i := range o.ownedConditions { - if i == t { - return true - } - } - return false + return slices.Contains(o.ownedConditions, t) } // ApplyOption defines an option for applying a condition patch. diff --git a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go index 9a5c5ef10..ade90bc22 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go +++ b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go @@ -17,6 +17,7 @@ limitations under the License. package v1 import ( + "slices" "sort" "kmodules.xyz/client-go/meta" @@ -31,22 +32,15 @@ import ( var json = jsoniter.ConfigFastest func AddFinalizer(m metav1.ObjectMeta, finalizer string) metav1.ObjectMeta { - for _, name := range m.Finalizers { - if name == finalizer { - return m - } + if slices.Contains(m.Finalizers, finalizer) { + return m } m.Finalizers = append(m.Finalizers, finalizer) return m } func HasFinalizer(m metav1.ObjectMeta, finalizer string) bool { - for _, name := range m.Finalizers { - if name == finalizer { - return true - } - } - return false + return slices.Contains(m.Finalizers, finalizer) } func RemoveFinalizer(m metav1.ObjectMeta, finalizer string) metav1.ObjectMeta { diff --git a/vendor/kmodules.xyz/client-go/meta/conditions.go b/vendor/kmodules.xyz/client-go/meta/conditions.go index 2c72db47b..347928703 100644 --- a/vendor/kmodules.xyz/client-go/meta/conditions.go +++ b/vendor/kmodules.xyz/client-go/meta/conditions.go @@ -18,6 +18,7 @@ package meta import ( "fmt" + "slices" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -156,10 +157,8 @@ func (s Status) String() string { // not a valid status. func StatusFromStringOrDie(text string) Status { s := Status(text) - for _, r := range Statuses { - if s == r { - return s - } + if slices.Contains(Statuses, s) { + return s } panic(fmt.Errorf("string has invalid status: %s", s)) } diff --git a/vendor/kmodules.xyz/client-go/meta/encoding.go b/vendor/kmodules.xyz/client-go/meta/encoding.go index 1ba1b120f..cb562db72 100644 --- a/vendor/kmodules.xyz/client-go/meta/encoding.go +++ b/vendor/kmodules.xyz/client-go/meta/encoding.go @@ -174,7 +174,7 @@ func StringToQuantityHookFunc() mapstructure.DecodeHookFunc { if f.Kind() != reflect.String { return data, nil } - if t != reflect.TypeOf(resource.Quantity{}) { + if t != reflect.TypeFor[resource.Quantity]() { return data, nil } diff --git a/vendor/kmodules.xyz/client-go/meta/lib.go b/vendor/kmodules.xyz/client-go/meta/lib.go index 0e6f761e2..d9027fddf 100644 --- a/vendor/kmodules.xyz/client-go/meta/lib.go +++ b/vendor/kmodules.xyz/client-go/meta/lib.go @@ -18,6 +18,7 @@ package meta import ( "fmt" + "maps" "reflect" "strings" @@ -131,9 +132,7 @@ func OverwriteKeys(out map[string]string, ins ...map[string]string) map[string]s } for _, in := range ins { - for k, v := range in { - out[k] = v - } + maps.Copy(out, in) } return out } @@ -198,20 +197,6 @@ func ValidCronJobNameWithPrefixNSuffix(prefix, name, suffix string) string { return ValidNameWithPrefixNSuffix(prefix, name, suffix, MaxCronJobNameLength) } -func min(x, y int) int { - if x < y { - return x - } - return y -} - -func max(x, y int) int { - if x > y { - return x - } - return y -} - func IsOfficialType(group string) bool { switch { case group == "": diff --git a/vendor/kmodules.xyz/client-go/tools/healthchecker/const.go b/vendor/kmodules.xyz/client-go/tools/healthchecker/const.go new file mode 100644 index 000000000..940f53d69 --- /dev/null +++ b/vendor/kmodules.xyz/client-go/tools/healthchecker/const.go @@ -0,0 +1,45 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package healthchecker + +type HealthCheckFailureLabel string + +const ( + HealthCheckClientFailure HealthCheckFailureLabel = "ClientFailure" + HealthCheckPingFailure HealthCheckFailureLabel = "PingFailure" + HealthCheckWriteFailure HealthCheckFailureLabel = "WriteFailure" + HealthCheckReadFailure HealthCheckFailureLabel = "ReadFailure" + HealthCheckPrimaryFailure HealthCheckFailureLabel = "PrimaryFailure" + HealthCheckSecondaryFailure HealthCheckFailureLabel = "SecondaryFailure" + HealthCheckSecondaryUnusualLocked HealthCheckFailureLabel = "SecondaryUnusualLocked" + HealthCheckSecondaryLockCheckingFailure HealthCheckFailureLabel = "SecondaryLockCheckingFailure" + HealthCheckKubernetesClientFailure HealthCheckFailureLabel = "KubernetesClientFailure" + + // replica + HealthCheckReplicaFailure HealthCheckFailureLabel = "ReplicaFailure" + + // MariaDB Constants + HealthCheckClusterFailure HealthCheckFailureLabel = "ClusterFailure" + + // Redis Constants + HealthCheckClusterSlotFailure HealthCheckFailureLabel = "ClusterSlotFailure" + HealthCheckNodesNotReadyFailure HealthCheckFailureLabel = "NodesNotReadyFailure" + + // Write Check Constants + KubeDBSystemDatabase = "kubedb_system" + KubeDBWriteCheckTable = "kubedb_write_check" +) diff --git a/vendor/kmodules.xyz/client-go/tools/healthchecker/health_card.go b/vendor/kmodules.xyz/client-go/tools/healthchecker/health_card.go new file mode 100644 index 000000000..4224f6864 --- /dev/null +++ b/vendor/kmodules.xyz/client-go/tools/healthchecker/health_card.go @@ -0,0 +1,78 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package healthchecker + +import "k8s.io/klog/v2" + +type HealthCard struct { + lastFailure HealthCheckFailureLabel + totalFailure int32 + threshold int32 + clientCount int32 + key string +} + +func newHealthCard(key string, threshold int32) *HealthCard { + return &HealthCard{ + threshold: threshold, + key: key, + } +} + +// SetThreshold sets the current failure threshold. +// Call this function on the start of each health check. +func (hcf *HealthCard) SetThreshold(threshold int32) { + hcf.threshold = threshold +} + +// HasFailed returns true or false based on the threshold. +// Update the health check condition if this function returns true. +func (hcf *HealthCard) HasFailed(label HealthCheckFailureLabel, err error) bool { + if hcf.lastFailure == label { + hcf.totalFailure++ + } else { + hcf.totalFailure = 1 + } + hcf.lastFailure = label + klog.V(5).InfoS("Health check failed for database", "Key", hcf.key, "FailureType", hcf.lastFailure, "Error", err.Error(), "TotalFailure", hcf.totalFailure) + return hcf.totalFailure >= hcf.threshold +} + +// Clear is used to reset the error counter. +// Call this method after each successful health check. +func (hcf *HealthCard) Clear() { + hcf.totalFailure = 0 + hcf.lastFailure = "" +} + +// ClientCreated is used to track the client which are created on the health check. +// Call this method after a client is successfully created in the health check. +func (hcf *HealthCard) ClientCreated() { + hcf.clientCount++ +} + +// ClientClosed is used to track the client which are closed on the health check. +// Call this method after a client is successfully closed in the health check. +func (hcf *HealthCard) ClientClosed() { + hcf.clientCount-- +} + +// GetClientCount is used to get the current open client count. +// This should always be 0. +func (hcf *HealthCard) GetClientCount() int32 { + return hcf.clientCount +} diff --git a/vendor/kmodules.xyz/client-go/tools/healthchecker/health_checker.go b/vendor/kmodules.xyz/client-go/tools/healthchecker/health_checker.go new file mode 100644 index 000000000..9e27a5934 --- /dev/null +++ b/vendor/kmodules.xyz/client-go/tools/healthchecker/health_checker.go @@ -0,0 +1,128 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package healthchecker + +import ( + "context" + "sync" + "time" + + kmapi "kmodules.xyz/client-go/api/v1" + + "k8s.io/klog/v2" +) + +type HealthChecker struct { + healthCheckerMap map[string]healthCheckerData + mux sync.Mutex +} + +type healthCheckerData struct { + cancel context.CancelFunc + ticker *time.Ticker + lastPeriodSeconds int32 +} + +func NewHealthChecker() *HealthChecker { + return &HealthChecker{ + healthCheckerMap: make(map[string]healthCheckerData), + mux: sync.Mutex{}, + } +} + +// Start creates a health check go routine. +// Call this method after successful creation of all the replicas of a database. +func (hc *HealthChecker) Start(key string, healthCheckSpec kmapi.HealthCheckSpec, fn func(string, *HealthCard)) { + if healthCheckSpec.PeriodSeconds == nil || healthCheckSpec.TimeoutSeconds == nil || healthCheckSpec.FailureThreshold == nil { + klog.Errorf("spec.healthCheck values are nil, can't start or modify health check.") + return + } + + if *healthCheckSpec.PeriodSeconds <= 0 { + klog.Errorf("spec.healthCheck.PeriodSeconds can't be less than 1, can't start or modify health check.") + return + } + + if !hc.keyExists(key) { + ctx := context.Background() + ctx, cancel := context.WithCancel(ctx) + ticker := time.NewTicker(time.Duration(*healthCheckSpec.PeriodSeconds) * time.Second) + healthCheckStore := newHealthCard(key, *healthCheckSpec.FailureThreshold) + hc.set(key, healthCheckerData{ + cancel: cancel, + ticker: ticker, + lastPeriodSeconds: *healthCheckSpec.PeriodSeconds, + }) + go func() { + for { + select { + case <-ctx.Done(): + hc.delete(key) + cancel() + ticker.Stop() + klog.Infoln("Health check stopped for key " + key) + return + case <-ticker.C: + klog.V(5).Infoln("Health check running for key " + key) + fn(key, healthCheckStore) + klog.V(5).Infof("Debug client count = %d\n", healthCheckStore.GetClientCount()) + } + } + }() + } else { + data := hc.get(key) + if data.lastPeriodSeconds != *healthCheckSpec.PeriodSeconds { + data.ticker.Reset(time.Duration(*healthCheckSpec.PeriodSeconds) * time.Second) + data.lastPeriodSeconds = *healthCheckSpec.PeriodSeconds + hc.set(key, data) + } + } +} + +// Stop stops a health check go routine. +// Call this method when the database is deleted or halted. +func (hc *HealthChecker) Stop(key string) { + if hc.keyExists(key) { + hc.get(key).cancel() + hc.delete(key) + } +} + +func (hc *HealthChecker) keyExists(key string) bool { + hc.mux.Lock() + defer hc.mux.Unlock() + _, ok := hc.healthCheckerMap[key] + return ok +} + +func (hc *HealthChecker) get(key string) healthCheckerData { + hc.mux.Lock() + defer hc.mux.Unlock() + return hc.healthCheckerMap[key] +} + +func (hc *HealthChecker) set(key string, data healthCheckerData) { + hc.mux.Lock() + defer hc.mux.Unlock() + hc.healthCheckerMap[key] = data +} + +func (hc *HealthChecker) delete(key string) { + hc.mux.Lock() + defer hc.mux.Unlock() + delete(hc.healthCheckerMap, key) +} diff --git a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/openapi_generated.go b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/openapi_generated.go index db8183beb..0a3de5c98 100644 --- a/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/openapi_generated.go +++ b/vendor/kmodules.xyz/resource-metadata/apis/node/v1alpha1/openapi_generated.go @@ -17095,8 +17095,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_siteinfos.yaml b/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_siteinfos.yaml index 18f75a9c1..54a920d3b 100644 --- a/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_siteinfos.yaml +++ b/vendor/kmodules.xyz/resource-metadata/crds/identity.k8s.appscode.com_siteinfos.yaml @@ -125,6 +125,21 @@ spec: items: type: string type: array + features: + properties: + disabledFeatures: + items: + type: string + type: array + enabledFeatures: + additionalProperties: + type: string + type: object + externallyManagedFeatures: + items: + type: string + type: array + type: object nodeStats: properties: allocatable: diff --git a/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/const.go b/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/const.go index 2a79ec7c7..ef07e7f31 100644 --- a/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/const.go +++ b/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/const.go @@ -81,3 +81,9 @@ const ( WALG_FILE_PREFIX = "WALG_FILE_PREFIX" OPLOG_PUSH_WAIT_FOR_BECOME_PRIMARY = "OPLOG_PUSH_WAIT_FOR_BECOME_PRIMARY" ) + +// Sidekick's ExtraArgs keys +const ( + ExtraArgsKeyStorage string = "Storage" + ExtraArgsKeyLogBackupOpt string = "LogBackupOpt" +) diff --git a/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/helpers.go b/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/helpers.go index b9afe25ff..1bb9c4f84 100644 --- a/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/helpers.go @@ -17,8 +17,12 @@ limitations under the License. package v1alpha1 import ( + "encoding/json" + "fmt" + "kubedb.dev/apimachinery/crds" + "k8s.io/apimachinery/pkg/runtime" "kmodules.xyz/client-go/apiextensions" ) @@ -55,3 +59,27 @@ func SetDefaultLogBackupOptions(log *LogBackupOptions) *LogBackupOptions { } return log } + +func GetValueFromExtraArgs(args map[string]runtime.RawExtension, key string, valType any) (any, error) { + var err error + if val, ok := args[key]; ok { + err = json.Unmarshal(val.Raw, &valType) + if err != nil { + return nil, fmt.Errorf("failed to parse value for key %s from extra arg maps. Reason: %w", key, err) + } + return valType, nil + } + + return nil, fmt.Errorf("key %s not found in extra arg maps", key) +} + +func SetKeyValueToExtraArgs(args map[string]runtime.RawExtension, key string, value any) error { + jsonVal, err := json.Marshal(value) + if err != nil { + return fmt.Errorf("failed to marshal value for key %s to json. Reason: %w", key, err) + } + args[key] = runtime.RawExtension{ + Raw: jsonVal, + } + return nil +} diff --git a/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/openapi_generated.go index 902610dd5..91265758a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/archiver/v1alpha1/openapi_generated.go @@ -28741,8 +28741,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/autoscaling/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/autoscaling/v1alpha1/openapi_generated.go index 79360730f..6105c7bac 100644 --- a/vendor/kubedb.dev/apimachinery/apis/autoscaling/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/autoscaling/v1alpha1/openapi_generated.go @@ -28878,8 +28878,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/db2_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/db2_version_types.go index ebbf2bbe0..b71058dbf 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/db2_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/db2_version_types.go @@ -59,8 +59,7 @@ type DB2VersionSpec struct { // Database Image DB DB2VersionDatabase `json:"db"` // Coordinator Image - // +optional - Coordinator DB2Coordinator `json:"coordinator,omitempty"` + Coordinator DB2Coordinator `json:"coordinator"` // Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded. // +optional Deprecated bool `json:"deprecated,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/hanadb_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/hanadb_version_types.go index 2397a55f8..818ad5210 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/hanadb_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/hanadb_version_types.go @@ -49,13 +49,10 @@ type HanaDBVersion struct { type HanaDBVersionSpec struct { // Version Version string `json:"version"` - - // EndOfLife refers if this version reached into its end of the life or not, based on https://endoflife.date/ - // +optional - EndOfLife bool `json:"endOfLife"` - // Database Image DB HanaDatabase `json:"db"` + // Coordinator Image + Coordinator HanaDBCoordinator `json:"coordinator"` // Deprecated versions usable but considered as obsolete and best avoided typically superseded Deprecated bool `json:"deprecated,omitempty"` // SecurityContext is for the additional config for the DB container @@ -78,6 +75,11 @@ type HanaDatabase struct { Image string `json:"image"` } +// HanaDBCoordinator is the HanaDB coordinator Container image +type HanaDBCoordinator struct { + Image string `json:"image"` +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // HanaDBVersionList is a list of HanaDBVersions diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mariadb_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mariadb_version_types.go index 14dcb8de4..52dca6aa1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mariadb_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mariadb_version_types.go @@ -65,7 +65,7 @@ type MariaDBVersionSpec struct { // Exporter Image Exporter MariaDBVersionExporter `json:"exporter"` // Coordinator Image - Coordinator MariaDBVersionCoordinator `json:"coordinator,omitempty"` + Coordinator MariaDBVersionCoordinator `json:"coordinator"` // Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded. // +optional Deprecated bool `json:"deprecated,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mssqlserver_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mssqlserver_version_types.go index 3e518654c..0aa5735cd 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mssqlserver_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mssqlserver_version_types.go @@ -58,8 +58,7 @@ type MSSQLServerVersionSpec struct { // Database Image DB MSSQLServerDatabase `json:"db"` // Coordinator Image - // +optional - Coordinator MSSQLServerCoordinator `json:"coordinator,omitempty"` + Coordinator MSSQLServerCoordinator `json:"coordinator"` // Exporter Image Exporter MSSQLServerVersionExporter `json:"exporter"` // Init container Image diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mysql_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mysql_version_types.go index fbe5cbbd0..dc7dec83f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mysql_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/mysql_version_types.go @@ -65,8 +65,7 @@ type MySQLVersionSpec struct { // Exporter Image Exporter MySQLVersionExporter `json:"exporter"` // Coordinator Image - // +optional - Coordinator MySQLVersionCoordinator `json:"coordinator,omitempty"` + Coordinator MySQLVersionCoordinator `json:"coordinator"` // ReplicationModeDetector Image // +optional ReplicationModeDetector ReplicationModeDetector `json:"replicationModeDetector,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/openapi_generated.go index 2276c8a0a..b90f311c8 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/openapi_generated.go @@ -632,6 +632,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/catalog/v1alpha1.FullBackup": schema_apimachinery_apis_catalog_v1alpha1_FullBackup(ref), "kubedb.dev/apimachinery/apis/catalog/v1alpha1.FullBackupRestore": schema_apimachinery_apis_catalog_v1alpha1_FullBackupRestore(ref), "kubedb.dev/apimachinery/apis/catalog/v1alpha1.GitSyncer": schema_apimachinery_apis_catalog_v1alpha1_GitSyncer(ref), + "kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDBCoordinator": schema_apimachinery_apis_catalog_v1alpha1_HanaDBCoordinator(ref), "kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDBSecurityContext": schema_apimachinery_apis_catalog_v1alpha1_HanaDBSecurityContext(ref), "kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDBVersion": schema_apimachinery_apis_catalog_v1alpha1_HanaDBVersion(ref), "kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDBVersionList": schema_apimachinery_apis_catalog_v1alpha1_HanaDBVersionList(ref), @@ -28946,8 +28947,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", @@ -34484,7 +34486,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_DB2VersionSpec(ref common.Referen }, }, }, - Required: []string{"version", "db"}, + Required: []string{"version", "db", "coordinator"}, }, }, Dependencies: []string{ @@ -35562,6 +35564,27 @@ func schema_apimachinery_apis_catalog_v1alpha1_GitSyncer(ref common.ReferenceCal } } +func schema_apimachinery_apis_catalog_v1alpha1_HanaDBCoordinator(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "HanaDBCoordinator is the HanaDB coordinator Container image", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "image": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"image"}, + }, + }, + } +} + func schema_apimachinery_apis_catalog_v1alpha1_HanaDBSecurityContext(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -35691,14 +35714,6 @@ func schema_apimachinery_apis_catalog_v1alpha1_HanaDBVersionSpec(ref common.Refe Format: "", }, }, - "endOfLife": { - SchemaProps: spec.SchemaProps{ - Description: "EndOfLife refers if this version reached into its end of the life or not, based on https://endoflife.date/", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, "db": { SchemaProps: spec.SchemaProps{ Description: "Database Image", @@ -35706,6 +35721,13 @@ func schema_apimachinery_apis_catalog_v1alpha1_HanaDBVersionSpec(ref common.Refe Ref: ref("kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDatabase"), }, }, + "coordinator": { + SchemaProps: spec.SchemaProps{ + Description: "Coordinator Image", + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDBCoordinator"), + }, + }, "deprecated": { SchemaProps: spec.SchemaProps{ Description: "Deprecated versions usable but considered as obsolete and best avoided typically superseded", @@ -35741,11 +35763,11 @@ func schema_apimachinery_apis_catalog_v1alpha1_HanaDBVersionSpec(ref common.Refe }, }, }, - Required: []string{"version", "db"}, + Required: []string{"version", "db", "coordinator"}, }, }, Dependencies: []string{ - "kubedb.dev/apimachinery/apis/catalog/v1alpha1.ChartInfo", "kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDBSecurityContext", "kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDatabase", "kubedb.dev/apimachinery/apis/catalog/v1alpha1.UpdateConstraints"}, + "kubedb.dev/apimachinery/apis/catalog/v1alpha1.ChartInfo", "kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDBCoordinator", "kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDBSecurityContext", "kubedb.dev/apimachinery/apis/catalog/v1alpha1.HanaDatabase", "kubedb.dev/apimachinery/apis/catalog/v1alpha1.UpdateConstraints"}, } } @@ -36886,7 +36908,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_MSSQLServerVersionSpec(ref common }, }, }, - Required: []string{"version", "db", "exporter", "initContainer"}, + Required: []string{"version", "db", "coordinator", "exporter", "initContainer"}, }, }, Dependencies: []string{ @@ -37278,7 +37300,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_MariaDBVersionSpec(ref common.Ref }, }, }, - Required: []string{"version", "db", "exporter", "initContainer", "podSecurityPolicies"}, + Required: []string{"version", "db", "exporter", "coordinator", "initContainer", "podSecurityPolicies"}, }, }, Dependencies: []string{ @@ -38530,7 +38552,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_MySQLVersionSpec(ref common.Refer }, }, }, - Required: []string{"version", "db", "exporter", "initContainer", "podSecurityPolicies"}, + Required: []string{"version", "db", "exporter", "coordinator", "initContainer", "podSecurityPolicies"}, }, }, Dependencies: []string{ @@ -39068,7 +39090,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_OracleVersionSpec(ref common.Refe }, }, }, - Required: []string{"version", "db", "exporter"}, + Required: []string{"version", "db", "exporter", "coordinator"}, }, }, Dependencies: []string{ @@ -39376,7 +39398,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_PerconaXtraDBVersionSpec(ref comm }, }, }, - Required: []string{"version", "db", "exporter", "initContainer", "podSecurityPolicies"}, + Required: []string{"version", "db", "exporter", "coordinator", "initContainer", "podSecurityPolicies"}, }, }, Dependencies: []string{ @@ -40273,7 +40295,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_PostgresVersionSpec(ref common.Re }, }, }, - Required: []string{"version", "db", "exporter", "podSecurityPolicies"}, + Required: []string{"version", "db", "exporter", "coordinator", "podSecurityPolicies"}, }, }, Dependencies: []string{ @@ -41241,7 +41263,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_RedisVersionSpec(ref common.Refer }, }, }, - Required: []string{"version", "db", "exporter", "podSecurityPolicies"}, + Required: []string{"version", "db", "exporter", "coordinator", "podSecurityPolicies"}, }, }, Dependencies: []string{ @@ -41703,8 +41725,9 @@ func schema_apimachinery_apis_catalog_v1alpha1_SinglestoreVersionSpec(ref common }, "coordinator": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kubedb.dev/apimachinery/apis/catalog/v1alpha1.SinglestoreCoordinator"), + Description: "Coordinator Image", + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/catalog/v1alpha1.SinglestoreCoordinator"), }, }, "standalone": { @@ -41748,7 +41771,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_SinglestoreVersionSpec(ref common }, }, }, - Required: []string{"version", "db"}, + Required: []string{"version", "db", "coordinator"}, }, }, Dependencies: []string{ @@ -42495,7 +42518,7 @@ func schema_apimachinery_apis_catalog_v1alpha1_ZooKeeperVersionSpec(ref common.R }, }, }, - Required: []string{"version", "db"}, + Required: []string{"version", "db", "coordinator"}, }, }, Dependencies: []string{ diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/oracle_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/oracle_version_types.go index 695d9761c..e78bf34f7 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/oracle_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/oracle_version_types.go @@ -66,7 +66,7 @@ type OracleVersionSpec struct { // Exporter Image Exporter OracleVersionExporter `json:"exporter"` // Coordinator Image - Coordinator OracleVersionCoordinator `json:"coordinator,omitempty"` + Coordinator OracleVersionCoordinator `json:"coordinator"` // DataGuard Images DataGuard OracleDataGuard `json:"dataGuard,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/perconaxtradb_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/perconaxtradb_version_types.go index e12c1bdf4..a2a947f76 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/perconaxtradb_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/perconaxtradb_version_types.go @@ -62,7 +62,7 @@ type PerconaXtraDBVersionSpec struct { // Exporter Image Exporter PerconaXtraDBVersionExporter `json:"exporter"` // Coordinator Image - Coordinator PerconaXtraDBVersionCoordinator `json:"coordinator,omitempty"` + Coordinator PerconaXtraDBVersionCoordinator `json:"coordinator"` // Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded. // +optional Deprecated bool `json:"deprecated,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/postgres_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/postgres_version_types.go index 5f3370527..3568f65e2 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/postgres_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/postgres_version_types.go @@ -69,7 +69,7 @@ type PostgresVersionSpec struct { // Exporter Image Exporter PostgresVersionExporter `json:"exporter"` // Coordinator Image - Coordinator PostgresVersionCoordinator `json:"coordinator,omitempty"` + Coordinator PostgresVersionCoordinator `json:"coordinator"` // Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded. // +optional Deprecated bool `json:"deprecated,omitempty"` @@ -152,7 +152,7 @@ type PostgresSecurityContext struct { RunAsAnyNonRoot bool `json:"runAsAnyNonRoot,omitempty"` } -// +kubebuilder:validation:Enum=Official;TimescaleDB;PostGIS;KubeDB;DocumentDB;PostgreSQL +// +kubebuilder:validation:Enum=Official;TimescaleDB;PostGIS;KubeDB;DocumentDB;PostgreSQL;Percona type PostgresDistro string const ( @@ -161,4 +161,5 @@ const ( PostgresDistroPostGIS PostgresDistro = "PostGIS" PostgresDistroKubeDB PostgresDistro = "KubeDB" PostgresDistroDocumentDB PostgresDistro = "DocumentDB" + PostgresDistroPercona PostgresDistro = "Percona" ) diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/redis_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/redis_version_types.go index f6225a2ae..ab4d2873f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/redis_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/redis_version_types.go @@ -66,7 +66,7 @@ type RedisVersionSpec struct { // Exporter Image Exporter RedisVersionExporter `json:"exporter"` // Coordinator Image - Coordinator RedisVersionCoordinator `json:"coordinator,omitempty"` + Coordinator RedisVersionCoordinator `json:"coordinator"` // Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded. // +optional Deprecated bool `json:"deprecated,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/singlestore_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/singlestore_version_types.go index aca2f5aa0..32a63c856 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/singlestore_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/singlestore_version_types.go @@ -57,8 +57,8 @@ type SinglestoreVersionSpec struct { // Database Image DB SinglestoreVersionDatabase `json:"db"` - // +optional - Coordinator SinglestoreCoordinator `json:"coordinator,omitempty"` + // Coordinator Image + Coordinator SinglestoreCoordinator `json:"coordinator"` // +optional Standalone SinglestoreStandaloneVersionDatabase `json:"standalone,omitempty"` // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/zookeeper_version_types.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/zookeeper_version_types.go index 5c09c1f5a..ad66f2ccd 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/zookeeper_version_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/zookeeper_version_types.go @@ -66,7 +66,7 @@ type ZooKeeperVersionSpec struct { // +optional Exporter ZooKeeperVersionExporter `json:"exporter"` // Coordinator Image - Coordinator ZooKeeperVersionCoordinator `json:"coordinator,omitempty"` + Coordinator ZooKeeperVersionCoordinator `json:"coordinator"` // Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded. // +optional Deprecated bool `json:"deprecated,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/zz_generated.deepcopy.go b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/zz_generated.deepcopy.go index 5dc864e4a..32e2a7051 100644 --- a/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kubedb.dev/apimachinery/apis/catalog/v1alpha1/zz_generated.deepcopy.go @@ -1218,6 +1218,22 @@ func (in *GitSyncer) DeepCopy() *GitSyncer { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HanaDBCoordinator) DeepCopyInto(out *HanaDBCoordinator) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HanaDBCoordinator. +func (in *HanaDBCoordinator) DeepCopy() *HanaDBCoordinator { + if in == nil { + return nil + } + out := new(HanaDBCoordinator) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HanaDBSecurityContext) DeepCopyInto(out *HanaDBSecurityContext) { *out = *in @@ -1308,6 +1324,7 @@ func (in *HanaDBVersionList) DeepCopyObject() runtime.Object { func (in *HanaDBVersionSpec) DeepCopyInto(out *HanaDBVersionSpec) { *out = *in out.DB = in.DB + out.Coordinator = in.Coordinator in.SecurityContext.DeepCopyInto(&out.SecurityContext) if in.UI != nil { in, out := &in.UI, &out.UI diff --git a/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go index e199c4ddd..05b3d831e 100644 --- a/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go @@ -28718,8 +28718,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/elasticsearch/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/elasticsearch/v1alpha1/openapi_generated.go index 5debd6232..d66785129 100644 --- a/vendor/kubedb.dev/apimachinery/apis/elasticsearch/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/elasticsearch/v1alpha1/openapi_generated.go @@ -28717,8 +28717,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/gitops/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/gitops/v1alpha1/openapi_generated.go index a71d5a503..e9b3fb2f5 100644 --- a/vendor/kubedb.dev/apimachinery/apis/gitops/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/gitops/v1alpha1/openapi_generated.go @@ -28776,8 +28776,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/openapi_generated.go index 12f83bdd2..324a7db92 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/openapi_generated.go @@ -28735,8 +28735,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go index b2f417cc5..12e0b90ef 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go @@ -49,6 +49,7 @@ const ( ReplicationModeDetectorContainerName = "replication-mode-detector" DatabasePodPrimary = "primary" DatabasePodStandby = "standby" + DatabasePodSecondary = "secondary" ComponentDatabase = "database" ComponentConnectionPooler = "connection-pooler" @@ -2283,10 +2284,14 @@ const ( // Mount paths HanaDBDataDir = "/hana/mounts" HanaDBSecretMountPath = "/etc/hana-secrets" + HanaDBConfigFileName = "global.ini" + HanaDBConfigDir = "/hana/mounts/system/config" + HanaDBConfigMountPath = "/etc/hanadb-config" // Volume names HanaDBDataVolume = "data" HanaDBVolumePasswordSecret = "password-secret" + HanaDBConfigVolumeName = "hanadb-config" // User and Group IDs HanaDBUserID = 12000 // hxeadm UID @@ -2315,10 +2320,8 @@ const ( HanaDBPrimaryServicePortName = "primary" - HanaDBCoordinatorPort = 2380 - HanaDBCoordinatorClientPort = 2379 - HanaDBCoordinatorPortName = "coordinator" - HanaDBCoordinatorClientPortName = "coordinator-client" + HanaDBCoordinatorPort = 2380 + HanaDBCoordinatorClientPort = 2379 // TenantDatabaseName is the name of the KubeDB managed tenant database KubeDBTenantDatabaseName = "KUBEDB_HEALTH_CHECK" diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/openapi_generated.go index c41773c61..7f5ef2a81 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/openapi_generated.go @@ -28846,8 +28846,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go index 4a0db6427..79ec73ec6 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go @@ -19,6 +19,7 @@ package v1 import ( "fmt" "strconv" + "strings" "time" "kubedb.dev/apimachinery/apis" @@ -92,6 +93,15 @@ func (p Postgres) ReadReplicaSingleGroupOffshootSelectors(groupName string) map[ return sel } +func (p Postgres) GlobalSelectors() map[string]string { + sel := map[string]string{ + meta_util.NameLabelKey: p.ResourceFQN(), + meta_util.InstanceLabelKey: p.Name, + meta_util.ManagedByLabelKey: kubedb.GroupName, + } + return sel +} + func (p Postgres) OffshootLabels() map[string]string { return p.offshootLabels(p.OffshootSelectors(), nil) } @@ -373,20 +383,21 @@ func (p *Postgres) SetDefaults(postgresVersion *catalog.PostgresVersion) { } } + majorVersion := getOrExtractMajorPgVersion(postgresVersion) + if p.Spec.TLS != nil { if p.Spec.SSLMode == "" { p.Spec.SSLMode = PostgresSSLModeVerifyFull } - if p.Spec.ClientAuthMode == "" { - p.Spec.ClientAuthMode = ClientAuthModeMD5 - } } else { if p.Spec.SSLMode == "" { p.Spec.SSLMode = PostgresSSLModeDisable } - if p.Spec.ClientAuthMode == "" { - p.Spec.ClientAuthMode = ClientAuthModeMD5 - } + } + if p.Spec.ClientAuthMode == "" && majorVersion < 18 { + p.Spec.ClientAuthMode = ClientAuthModeMD5 + } else if p.Spec.ClientAuthMode == "" { + p.Spec.ClientAuthMode = ClientAuthModeScram } p.updateConfigurationFieldIfNeeded() @@ -413,7 +424,7 @@ func (p *Postgres) SetDefaults(postgresVersion *catalog.PostgresVersion) { } } if p.Spec.Init != nil && p.Spec.Init.Archiver != nil && p.Spec.Init.Archiver.ReplicationStrategy == nil { - p.Spec.Init.Archiver.ReplicationStrategy = ptr.To(ReplicationStrategyNone) + p.Spec.Init.Archiver.ReplicationStrategy = ptr.To(ReplicationStrategySync) } if p.Spec.Init != nil && p.Spec.Init.Archiver != nil { @@ -437,6 +448,22 @@ func getMajorPgVersion(postgresVersion *catalog.PostgresVersion) (uint64, error) return ver.Major(), nil } +func getOrExtractMajorPgVersion(postgresVersion *catalog.PostgresVersion) uint64 { + ver, err := getMajorPgVersion(postgresVersion) + if err == nil { + return ver + } + verSlice := strings.Split(postgresVersion.Spec.Version, ".") + if len(verSlice) == 0 { + return uint64(0) + } + version, err := strconv.Atoi(verSlice[0]) + if err != nil { + return uint64(0) + } + return uint64(version) +} + func (p *Postgres) defaultReadReplicaSpec(rr *ReadReplicaSpec) { if rr.Replicas == nil { rr.Replicas = pointer.Int32P(1) @@ -450,14 +477,15 @@ func (p *Postgres) defaultReadReplicaSpec(rr *ReadReplicaSpec) { } func (p *Postgres) updateConfigurationFieldIfNeeded() { + if p.Spec.Configuration != nil && p.Spec.ConfigSecret != nil && p.Spec.Configuration.SecretName == p.Spec.ConfigSecret.Name { + p.Spec.ConfigSecret = nil + } if p.Spec.Configuration == nil && p.Spec.ConfigSecret != nil { p.Spec.Configuration = &PostgresConfiguration{ ConfigurationSpec: ConfigurationSpec{SecretName: p.Spec.ConfigSecret.Name}, } - p.Spec.ConfigSecret = nil } else if p.Spec.ConfigSecret != nil && p.Spec.Configuration != nil && p.Spec.Configuration.SecretName == "" { p.Spec.Configuration.SecretName = p.Spec.ConfigSecret.Name - p.Spec.ConfigSecret = nil } } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha1/openapi_generated.go index 8e7d93fc2..694230a55 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha1/openapi_generated.go @@ -28775,8 +28775,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_helpers.go index 53a1494c9..9008515e0 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_helpers.go @@ -18,12 +18,17 @@ package v1alpha2 import ( "context" + "encoding/json" "fmt" + "strings" + "time" "kubedb.dev/apimachinery/apis" catalog "kubedb.dev/apimachinery/apis/catalog/v1alpha1" "kubedb.dev/apimachinery/apis/kubedb" "kubedb.dev/apimachinery/crds" + apiutils "kubedb.dev/apimachinery/pkg/utils" + raftutils "kubedb.dev/apimachinery/pkg/utils/raft" promapi "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "gomodules.xyz/pointer" @@ -43,6 +48,31 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ) +type SystemReplicationStatus struct { + Status string + Details string + ReplayBacklog string +} + +type SystemReplicationHealthSummary struct { + AllHealthy bool + HasActive bool + HasSyncing bool + HasError bool + Summary string +} + +const ( + SystemReplicationStatusColumn = "REPLICATION_STATUS" + SystemReplicationStatusDetailsColumn = "REPLICATION_STATUS_DETAILS" + SystemReplicationReplayBacklogColumn = "REPLAY_BACKLOG" +) + +const SystemReplicationStatusQuery = ` +SELECT REPLICATION_STATUS, REPLICATION_STATUS_DETAILS, + (LAST_LOG_POSITION - REPLAYED_LOG_POSITION) AS REPLAY_BACKLOG +FROM SYS.M_SERVICE_REPLICATION` + func (HanaDB) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralHanaDB)) } @@ -79,6 +109,213 @@ func (h *HanaDB) GoverningServiceName() string { return metautil.NameWithSuffix(h.ServiceName(), "pods") } +func (h *HanaDB) PrimaryServiceDNS() string { + return fmt.Sprintf("%s.%s.svc", h.ServiceName(), h.Namespace) +} + +func (h *HanaDB) GoverningServiceDNS(podName string) string { + return fmt.Sprintf("%s.%s.%s.svc.%s", podName, h.GoverningServiceName(), h.Namespace, apiutils.FindDomain()) +} + +type hanaRaftProvider struct { + dnsSuffix string + offshootName string +} + +func (p hanaRaftProvider) GoverningServiceDNS(podName string) string { + return podName + p.dnsSuffix +} + +func (p hanaRaftProvider) OffshootName() string { + return p.offshootName +} + +func getHanaRaftProvider(db *HanaDB) hanaRaftProvider { + return hanaRaftProvider{ + dnsSuffix: fmt.Sprintf(".%s.%s.svc.%s", db.GoverningServiceName(), db.Namespace, apiutils.FindDomain()), + offshootName: db.OffshootName(), + } +} + +// GetCurrentLeaderID queries raft leader id from a coordinator pod. +func GetCurrentLeaderID(db *HanaDB, podName, user, pass string) (uint64, error) { + return raftutils.GetCurrentLeaderID(kubedb.HanaDBCoordinatorClientPort, db.GoverningServiceDNS(podName), user, pass) +} + +// AddNodeToRaft requests raft membership add via coordinator /add-node endpoint. +func AddNodeToRaft(db *HanaDB, primaryPodName, podName string, nodeID int, user, pass string) (string, error) { + return raftutils.AddNodeToRaft(getHanaRaftProvider(db), kubedb.HanaDBCoordinatorClientPort, kubedb.HanaDBCoordinatorPort, primaryPodName, podName, nodeID, user, pass) +} + +// RemoveNodeFromRaft requests raft membership remove via coordinator /remove-node endpoint. +func RemoveNodeFromRaft(db *HanaDB, primaryPodName string, nodeID int, user, pass string) (string, error) { + return raftutils.RemoveNodeFromRaft(getHanaRaftProvider(db), kubedb.HanaDBCoordinatorClientPort, primaryPodName, nodeID, user, pass) +} + +// GetCurrentLeaderPodName returns current leader pod name by resolving raft leader id. +func GetCurrentLeaderPodName(db *HanaDB, podName, user, pass string) (string, error) { + return raftutils.GetCurrentLeaderPodName(getHanaRaftProvider(db), kubedb.HanaDBCoordinatorClientPort, podName, user, pass) +} + +func GetRaftLeaderIDWithRetries(db *HanaDB, dbPodName, user, pass string, maxTries int, retryDelay time.Duration) (int, error) { + return raftutils.GetRaftLeaderIDWithRetries(getHanaRaftProvider(db), kubedb.HanaDBCoordinatorClientPort, dbPodName, user, pass, maxTries, retryDelay) +} + +func GetRaftPrimaryNode(db *HanaDB, replicas int, user, pass string, maxTries int, retryDelay time.Duration) (int, error) { + return raftutils.GetRaftPrimaryNode(getHanaRaftProvider(db), kubedb.HanaDBCoordinatorClientPort, replicas, user, pass, maxTries, retryDelay) +} + +func AddRaftNodeWithRetries(db *HanaDB, primaryPodName, podName string, nodeID int, user, pass string, maxTries int, retryDelay time.Duration) error { + return raftutils.AddRaftNodeWithRetries(getHanaRaftProvider(db), kubedb.HanaDBCoordinatorClientPort, kubedb.HanaDBCoordinatorPort, primaryPodName, podName, nodeID, user, pass, maxTries, retryDelay) +} + +func RemoveRaftNodeWithRetries(db *HanaDB, primaryPodName string, nodeID int, user, pass string, maxTries int, retryDelay time.Duration) error { + return raftutils.RemoveRaftNodeWithRetries(getHanaRaftProvider(db), kubedb.HanaDBCoordinatorClientPort, primaryPodName, nodeID, user, pass, maxTries, retryDelay) +} + +func NewSystemReplicationStatus(status, details, replayBacklog string) SystemReplicationStatus { + return SystemReplicationStatus{ + Status: strings.ToUpper(strings.TrimSpace(status)), + Details: strings.TrimSpace(details), + ReplayBacklog: strings.TrimSpace(replayBacklog), + } +} + +func ParseSystemReplicationStatuses(rows []map[string]string) []SystemReplicationStatus { + statuses := make([]SystemReplicationStatus, 0, len(rows)) + for _, row := range rows { + status := NewSystemReplicationStatus( + row[SystemReplicationStatusColumn], + row[SystemReplicationStatusDetailsColumn], + row[SystemReplicationReplayBacklogColumn], + ) + if status.Status == "" { + continue + } + statuses = append(statuses, status) + } + return statuses +} + +func EvaluateSystemReplicationHealth(statuses []SystemReplicationStatus) SystemReplicationHealthSummary { + summary := SystemReplicationHealthSummary{ + AllHealthy: true, + } + if len(statuses) == 0 { + summary.AllHealthy = false + summary.Summary = "no replication status found" + return summary + } + + statusParts := make([]string, 0, len(statuses)) + for _, status := range statuses { + replStatus := strings.ToUpper(strings.TrimSpace(status.Status)) + replDetails := strings.TrimSpace(status.Details) + backlog := strings.TrimSpace(status.ReplayBacklog) + if replStatus == "" { + continue + } + + statusPart := replStatus + if backlog != "" && backlog != "0" { + statusPart += "(backlog:" + backlog + ")" + } + if replDetails != "" && replStatus != "ACTIVE" { + statusPart += "[" + replDetails + "]" + } + statusParts = append(statusParts, statusPart) + + switch replStatus { + case "ACTIVE": + summary.HasActive = true + case "SYNCING", "INITIALIZING", "UNKNOWN": + summary.HasSyncing = true + case "ERROR": + summary.HasError = true + default: + summary.HasSyncing = true + } + + if !isSystemReplicationMemberHealthy(replStatus, replDetails) { + summary.AllHealthy = false + } + } + + if len(statusParts) == 0 { + summary.AllHealthy = false + summary.Summary = "no replication status found" + return summary + } + + summary.Summary = strings.Join(statusParts, ", ") + return summary +} + +func isSystemReplicationMemberHealthy(status, details string) bool { + if status != "ACTIVE" { + return false + } + + if details == "" { + return true + } + + normalizedDetails := strings.ToUpper(details) + if strings.Contains(normalizedDetails, "DISCONNECT") || + strings.Contains(normalizedDetails, "ERROR") || + strings.Contains(normalizedDetails, "FAIL") || + strings.Contains(normalizedDetails, "SYNCING") || + strings.Contains(normalizedDetails, "INITIALIZ") || + strings.Contains(normalizedDetails, "UNKNOWN") { + return false + } + + // If details mention connectivity state, require connected. + if strings.Contains(normalizedDetails, "CONNECT") && + !strings.Contains(normalizedDetails, "CONNECTED") { + return false + } + + return true +} + +// GetAuthCredentialsFromSecret reads SYSTEM user/password from the auth secret. +func GetAuthCredentialsFromSecret(ctx context.Context, kc client.Client, db *HanaDB) (string, string, error) { + secret := &core.Secret{} + if err := kc.Get(ctx, types.NamespacedName{ + Namespace: db.Namespace, + Name: db.GetAuthSecretName(), + }, secret); err != nil { + return "", "", err + } + + user := kubedb.HanaDBSystemUser + if usernameBytes, ok := secret.Data[core.BasicAuthUsernameKey]; ok && len(usernameBytes) > 0 { + user = string(usernameBytes) + } + + if passwordBytes, ok := secret.Data[core.BasicAuthPasswordKey]; ok && len(passwordBytes) > 0 { + return user, string(passwordBytes), nil + } + + passwordJSON, ok := secret.Data[kubedb.HanaDBPasswordFileKey] + if !ok { + return "", "", fmt.Errorf("secret %s/%s missing %s key", secret.Namespace, secret.Name, kubedb.HanaDBPasswordFileKey) + } + + var passwordData struct { + MasterPassword string `json:"master_password"` + } + if err := json.Unmarshal(passwordJSON, &passwordData); err != nil { + return "", "", fmt.Errorf("failed to parse %s in secret %s/%s: %v", kubedb.HanaDBPasswordFileKey, secret.Namespace, secret.Name, err) + } + if passwordData.MasterPassword == "" { + return "", "", fmt.Errorf("master password not specified in secret %s/%s", secret.Namespace, secret.Name) + } + + return user, passwordData.MasterPassword, nil +} + func (h *HanaDB) offshootLabels(selector, override map[string]string) map[string]string { selector[metautil.ComponentLabelKey] = kubedb.ComponentDatabase return metautil.FilterKeys(SchemeGroupVersion.Group, selector, metautil.OverwriteKeys(nil, h.Labels, override)) @@ -233,6 +470,11 @@ func (h *HanaDB) IsCluster() bool { return h.Spec.Topology != nil } +func (h *HanaDB) IsSystemReplication() bool { + return h.Spec.Topology != nil && h.Spec.Topology.Mode != nil && + *h.Spec.Topology.Mode == HanaDBModeSystemReplication +} + func (h *HanaDB) SetHealthCheckerDefaults() { if h.Spec.HealthChecker.PeriodSeconds == nil { h.Spec.HealthChecker.PeriodSeconds = pointer.Int32P(120) @@ -274,6 +516,17 @@ func (h *HanaDB) SetDefaults(kc client.Client) { h.Spec.Replicas = pointer.Int32P(1) } } + if h.IsSystemReplication() { + if h.Spec.Topology.SystemReplication == nil { + h.Spec.Topology.SystemReplication = &HanaDBSystemReplicationSpec{} + } + if h.Spec.Topology.SystemReplication.ReplicationMode == "" { + h.Spec.Topology.SystemReplication.ReplicationMode = ReplicationModeSync + } + if h.Spec.Topology.SystemReplication.OperationMode == "" { + h.Spec.Topology.SystemReplication.OperationMode = OperationModeLogReplay + } + } h.setDefaultContainerSecurityContext(&hanadbVersion, h.Spec.PodTemplate) diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_types.go index 3e0133c6a..36c247a0e 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_types.go @@ -30,6 +30,25 @@ const ( ResourcePluralHanaDB = "hanadbs" ) +// +kubebuilder:validation:Enum=sync;syncmem;async;fullsync +type ReplicationMode string + +const ( + ReplicationModeSync ReplicationMode = "sync" + ReplicationModeSyncMem ReplicationMode = "syncmem" + ReplicationModeAsync ReplicationMode = "async" + ReplicationModeFullSync ReplicationMode = "fullsync" +) + +// +kubebuilder:validation:Enum=logreplay;delta_datashipping;logreplay_readaccess +type OperationMode string + +const ( + OperationModeLogReplay OperationMode = "logreplay" + OperationModeDeltaDataShipping OperationMode = "delta_datashipping" + OperationModeLogReplayReadAccess OperationMode = "logreplay_readaccess" +) + // +kubebuilder:validation:Enum=Standalone;SystemReplication type HanaDBMode string @@ -115,6 +134,23 @@ type HanaDBTopology struct { // Mode specifies the deployment mode. // +optional Mode *HanaDBMode `json:"mode,omitempty"` + + // SystemReplication defines configuration for SAP HANA system replication. + // +optional + SystemReplication *HanaDBSystemReplicationSpec `json:"systemReplication,omitempty"` +} + +// HanaDBSystemReplicationSpec defines system replication configuration. +type HanaDBSystemReplicationSpec struct { + // ReplicationMode controls when transactions are committed relative to log shipping. + // +optional + // +kubebuilder:default=sync + ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` + + // OperationMode controls the log shipping/replay strategy on the secondary. + // +optional + // +kubebuilder:default=logreplay + OperationMode OperationMode `json:"operationMode,omitempty"` } // HanaDBStatus defines the observed state of HanaDB. diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_helpers.go index 60b9d81f3..158271024 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_helpers.go @@ -183,7 +183,7 @@ func (r *Neo4j) SetTLSDefaults() { } } if r.Spec.TLS.Cluster == nil { - r.Spec.TLS.HTTP = &ProtocolTLSConfig{ + r.Spec.TLS.Cluster = &ProtocolTLSConfig{ Mode: TLSModeMTLS, } } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go index 557416ae5..565c754ca 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go @@ -650,6 +650,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HanaDBList": schema_apimachinery_apis_kubedb_v1alpha2_HanaDBList(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HanaDBSpec": schema_apimachinery_apis_kubedb_v1alpha2_HanaDBSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HanaDBStatus": schema_apimachinery_apis_kubedb_v1alpha2_HanaDBStatus(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HanaDBSystemReplicationSpec": schema_apimachinery_apis_kubedb_v1alpha2_HanaDBSystemReplicationSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HanaDBTopology": schema_apimachinery_apis_kubedb_v1alpha2_HanaDBTopology(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Hazelcast": schema_apimachinery_apis_kubedb_v1alpha2_Hazelcast(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HazelcastApp": schema_apimachinery_apis_kubedb_v1alpha2_HazelcastApp(ref), @@ -813,6 +814,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SolrNode": schema_apimachinery_apis_kubedb_v1alpha2_SolrNode(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SolrSpec": schema_apimachinery_apis_kubedb_v1alpha2_SolrSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SolrStatus": schema_apimachinery_apis_kubedb_v1alpha2_SolrStatus(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SystemReplicationHealthSummary": schema_apimachinery_apis_kubedb_v1alpha2_SystemReplicationHealthSummary(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SystemReplicationStatus": schema_apimachinery_apis_kubedb_v1alpha2_SystemReplicationStatus(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SystemUserSecretsSpec": schema_apimachinery_apis_kubedb_v1alpha2_SystemUserSecretsSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.TLSPolicy": schema_apimachinery_apis_kubedb_v1alpha2_TLSPolicy(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Topology": schema_apimachinery_apis_kubedb_v1alpha2_Topology(ref), @@ -831,6 +834,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.elasticsearchStatsService": schema_apimachinery_apis_kubedb_v1alpha2_elasticsearchStatsService(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.etcdApp": schema_apimachinery_apis_kubedb_v1alpha2_etcdApp(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.etcdStatsService": schema_apimachinery_apis_kubedb_v1alpha2_etcdStatsService(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.hanaRaftProvider": schema_apimachinery_apis_kubedb_v1alpha2_hanaRaftProvider(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.hanadbApp": schema_apimachinery_apis_kubedb_v1alpha2_hanadbApp(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.hanadbStatsService": schema_apimachinery_apis_kubedb_v1alpha2_hanadbStatsService(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.hazelcastStatsService": schema_apimachinery_apis_kubedb_v1alpha2_hazelcastStatsService(ref), @@ -29003,8 +29007,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", @@ -37335,6 +37340,33 @@ func schema_apimachinery_apis_kubedb_v1alpha2_HanaDBStatus(ref common.ReferenceC } } +func schema_apimachinery_apis_kubedb_v1alpha2_HanaDBSystemReplicationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "HanaDBSystemReplicationSpec defines system replication configuration.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "replicationMode": { + SchemaProps: spec.SchemaProps{ + Description: "ReplicationMode controls when transactions are committed relative to log shipping.", + Type: []string{"string"}, + Format: "", + }, + }, + "operationMode": { + SchemaProps: spec.SchemaProps{ + Description: "OperationMode controls the log shipping/replay strategy on the secondary.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_apimachinery_apis_kubedb_v1alpha2_HanaDBTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -37349,9 +37381,17 @@ func schema_apimachinery_apis_kubedb_v1alpha2_HanaDBTopology(ref common.Referenc Format: "", }, }, + "systemReplication": { + SchemaProps: spec.SchemaProps{ + Description: "SystemReplication defines configuration for SAP HANA system replication.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HanaDBSystemReplicationSpec"), + }, + }, }, }, }, + Dependencies: []string{ + "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HanaDBSystemReplicationSpec"}, } } @@ -46356,6 +46396,88 @@ func schema_apimachinery_apis_kubedb_v1alpha2_SolrStatus(ref common.ReferenceCal } } +func schema_apimachinery_apis_kubedb_v1alpha2_SystemReplicationHealthSummary(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "AllHealthy": { + SchemaProps: spec.SchemaProps{ + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "HasActive": { + SchemaProps: spec.SchemaProps{ + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "HasSyncing": { + SchemaProps: spec.SchemaProps{ + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "HasError": { + SchemaProps: spec.SchemaProps{ + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "Summary": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"AllHealthy", "HasActive", "HasSyncing", "HasError", "Summary"}, + }, + }, + } +} + +func schema_apimachinery_apis_kubedb_v1alpha2_SystemReplicationStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Status": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "Details": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "ReplayBacklog": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"Status", "Details", "ReplayBacklog"}, + }, + }, + } +} + func schema_apimachinery_apis_kubedb_v1alpha2_SystemUserSecretsSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -47104,6 +47226,33 @@ func schema_apimachinery_apis_kubedb_v1alpha2_etcdStatsService(ref common.Refere } } +func schema_apimachinery_apis_kubedb_v1alpha2_hanaRaftProvider(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dnsSuffix": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "offshootName": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"dnsSuffix", "offshootName"}, + }, + }, + } +} + func schema_apimachinery_apis_kubedb_v1alpha2_hanadbApp(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.deepcopy.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.deepcopy.go index 23654c908..1ca9358ae 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.deepcopy.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.deepcopy.go @@ -2412,6 +2412,22 @@ func (in *HanaDBStatus) DeepCopy() *HanaDBStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HanaDBSystemReplicationSpec) DeepCopyInto(out *HanaDBSystemReplicationSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HanaDBSystemReplicationSpec. +func (in *HanaDBSystemReplicationSpec) DeepCopy() *HanaDBSystemReplicationSpec { + if in == nil { + return nil + } + out := new(HanaDBSystemReplicationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HanaDBTopology) DeepCopyInto(out *HanaDBTopology) { *out = *in @@ -2420,6 +2436,11 @@ func (in *HanaDBTopology) DeepCopyInto(out *HanaDBTopology) { *out = new(HanaDBMode) **out = **in } + if in.SystemReplication != nil { + in, out := &in.SystemReplication, &out.SystemReplication + *out = new(HanaDBSystemReplicationSpec) + **out = **in + } return } @@ -7723,6 +7744,38 @@ func (in *SolrStatus) DeepCopy() *SolrStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SystemReplicationHealthSummary) DeepCopyInto(out *SystemReplicationHealthSummary) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemReplicationHealthSummary. +func (in *SystemReplicationHealthSummary) DeepCopy() *SystemReplicationHealthSummary { + if in == nil { + return nil + } + out := new(SystemReplicationHealthSummary) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SystemReplicationStatus) DeepCopyInto(out *SystemReplicationStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemReplicationStatus. +func (in *SystemReplicationStatus) DeepCopy() *SystemReplicationStatus { + if in == nil { + return nil + } + out := new(SystemReplicationStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SystemUserSecretsSpec) DeepCopyInto(out *SystemUserSecretsSpec) { *out = *in diff --git a/vendor/kubedb.dev/apimachinery/apis/migrator/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/migrator/v1alpha1/openapi_generated.go index a4122bb84..8df12fe2e 100644 --- a/vendor/kubedb.dev/apimachinery/apis/migrator/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/migrator/v1alpha1/openapi_generated.go @@ -28732,8 +28732,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go index f81d27a2b..d448ac7bc 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go @@ -131,6 +131,7 @@ const ( // Reload const ( + ReloadTLS = "ReloadTLS" ReloadPods = "ReloadPods" ReloadPodsSucceeded = "ReloadPodsSucceeded" ReloadPodsFailed = "ReloadPodsFailed" diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/neo4j_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/neo4j_ops_types.go index f69d45427..853de0a9f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/neo4j_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/neo4j_ops_types.go @@ -18,6 +18,8 @@ limitations under the License. package v1alpha1 import ( + dbapi "kubedb.dev/apimachinery/apis/kubedb/v1alpha2" + core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -56,6 +58,8 @@ type Neo4jOpsRequestSpec struct { Type Neo4jOpsRequestType `json:"type"` // Specifies information necessary for restarting database Restart *RestartSpec `json:"restart,omitempty"` + // Specifies information necessary for configuring TLS + TLS *Neo4jTLSSpec `json:"tls,omitempty"` // Timeout for each step of the ops request in second. If a step doesn't finish within the specified timeout, the ops request will result in failure. Timeout *metav1.Duration `json:"timeout,omitempty"` // ApplyOption is to control the execution of OpsRequest depending on the database state. @@ -65,8 +69,22 @@ type Neo4jOpsRequestSpec struct { MaxRetries int32 `json:"maxRetries,omitempty"` } -// +kubebuilder:validation:Enum=Restart; -// ENUM(Restart) +type Neo4jTLSSpec struct { + // Neo4jTLSSpec contains updated tls configurations for client and server. + // +optional + dbapi.Neo4jTLSConfig `json:",inline,omitempty"` + + // RotateCertificates tells operator to initiate certificate rotation + // +optional + RotateCertificates bool `json:"rotateCertificates,omitempty"` + + // Remove tells operator to remove TLS configuration + // +optional + Remove bool `json:"remove,omitempty"` +} + +// +kubebuilder:validation:Enum=Restart;ReconfigureTLS +// ENUM(Restart,ReconfigureTLS) type Neo4jOpsRequestType string // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/neo4j_ops_types_enum.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/neo4j_ops_types_enum.go index 5ad8efa6f..e69468990 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/neo4j_ops_types_enum.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/neo4j_ops_types_enum.go @@ -13,12 +13,15 @@ import ( const ( // Neo4jOpsRequestTypeRestart is a Neo4jOpsRequestType of type Restart. Neo4jOpsRequestTypeRestart Neo4jOpsRequestType = "Restart" + // Neo4jOpsRequestTypeReconfigureTLS is a Neo4jOpsRequestType of type ReconfigureTLS. + Neo4jOpsRequestTypeReconfigureTLS Neo4jOpsRequestType = "ReconfigureTLS" ) var ErrInvalidNeo4jOpsRequestType = fmt.Errorf("not a valid Neo4jOpsRequestType, try [%s]", strings.Join(_Neo4jOpsRequestTypeNames, ", ")) var _Neo4jOpsRequestTypeNames = []string{ string(Neo4jOpsRequestTypeRestart), + string(Neo4jOpsRequestTypeReconfigureTLS), } // Neo4jOpsRequestTypeNames returns a list of possible string values of Neo4jOpsRequestType. @@ -32,6 +35,7 @@ func Neo4jOpsRequestTypeNames() []string { func Neo4jOpsRequestTypeValues() []Neo4jOpsRequestType { return []Neo4jOpsRequestType{ Neo4jOpsRequestTypeRestart, + Neo4jOpsRequestTypeReconfigureTLS, } } @@ -48,7 +52,8 @@ func (x Neo4jOpsRequestType) IsValid() bool { } var _Neo4jOpsRequestTypeValue = map[string]Neo4jOpsRequestType{ - "Restart": Neo4jOpsRequestTypeRestart, + "Restart": Neo4jOpsRequestTypeRestart, + "ReconfigureTLS": Neo4jOpsRequestTypeReconfigureTLS, } // ParseNeo4jOpsRequestType attempts to convert a string to a Neo4jOpsRequestType. diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go index 3552b1dde..4a7b49c5b 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go @@ -715,6 +715,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.Neo4jOpsRequest": schema_apimachinery_apis_ops_v1alpha1_Neo4jOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.Neo4jOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_Neo4jOpsRequestList(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.Neo4jOpsRequestSpec": schema_apimachinery_apis_ops_v1alpha1_Neo4jOpsRequestSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.Neo4jTLSSpec": schema_apimachinery_apis_ops_v1alpha1_Neo4jTLSSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.OpsRequestStatus": schema_apimachinery_apis_ops_v1alpha1_OpsRequestStatus(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_PerconaXtraDBCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_PerconaXtraDBHorizontalScalingSpec(ref), @@ -28967,8 +28968,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", @@ -39217,6 +39219,12 @@ func schema_apimachinery_apis_ops_v1alpha1_Neo4jOpsRequestSpec(ref common.Refere Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"), }, }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies information necessary for configuring TLS", + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.Neo4jTLSSpec"), + }, + }, "timeout": { SchemaProps: spec.SchemaProps{ Description: "Timeout for each step of the ops request in second. If a step doesn't finish within the specified timeout, the ops request will result in failure.", @@ -39241,7 +39249,76 @@ func schema_apimachinery_apis_ops_v1alpha1_Neo4jOpsRequestSpec(ref common.Refere }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.Neo4jTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_Neo4jTLSSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "issuerRef": { + SchemaProps: spec.SchemaProps{ + Description: "IssuerRef is a reference to a Certificate Issuer.", + Ref: ref("k8s.io/api/core/v1.TypedLocalObjectReference"), + }, + }, + "certificates": { + SchemaProps: spec.SchemaProps{ + Description: "Certificate provides server and/or client certificate options used by application pods. These options are passed to a cert-manager Certificate object. xref: https://github.com/jetstack/cert-manager/blob/v0.16.0/pkg/apis/certmanager/v1beta1/types_certificate.go#L82-L162", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.CertificateSpec"), + }, + }, + }, + }, + }, + "bolt": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ProtocolTLSConfig"), + }, + }, + "http": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ProtocolTLSConfig"), + }, + }, + "cluster": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ProtocolTLSConfig"), + }, + }, + "keystoreCredSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Keystore encryption secret", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), + }, + }, + "rotateCertificates": { + SchemaProps: spec.SchemaProps{ + Description: "RotateCertificates tells operator to initiate certificate rotation", + Type: []string{"boolean"}, + Format: "", + }, + }, + "remove": { + SchemaProps: spec.SchemaProps{ + Description: "Remove tells operator to remove TLS configuration", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.TypedLocalObjectReference", "kmodules.xyz/client-go/api/v1.CertificateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ProtocolTLSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zz_generated.deepcopy.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zz_generated.deepcopy.go index d6a5af702..6bdf07d3d 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zz_generated.deepcopy.go @@ -4161,6 +4161,11 @@ func (in *Neo4jOpsRequestSpec) DeepCopyInto(out *Neo4jOpsRequestSpec) { *out = new(RestartSpec) **out = **in } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(Neo4jTLSSpec) + (*in).DeepCopyInto(*out) + } if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout *out = new(metav1.Duration) @@ -4179,6 +4184,23 @@ func (in *Neo4jOpsRequestSpec) DeepCopy() *Neo4jOpsRequestSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Neo4jTLSSpec) DeepCopyInto(out *Neo4jTLSSpec) { + *out = *in + in.Neo4jTLSConfig.DeepCopyInto(&out.Neo4jTLSConfig) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Neo4jTLSSpec. +func (in *Neo4jTLSSpec) DeepCopy() *Neo4jTLSSpec { + if in == nil { + return nil + } + out := new(Neo4jTLSSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OpsRequestStatus) DeepCopyInto(out *OpsRequestStatus) { *out = *in diff --git a/vendor/kubedb.dev/apimachinery/apis/postgres/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/postgres/v1alpha1/openapi_generated.go index 290b17b2f..97bf2c4df 100644 --- a/vendor/kubedb.dev/apimachinery/apis/postgres/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/postgres/v1alpha1/openapi_generated.go @@ -28728,8 +28728,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/schema/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/schema/v1alpha1/openapi_generated.go index 0e5360495..6837ba0cf 100644 --- a/vendor/kubedb.dev/apimachinery/apis/schema/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/schema/v1alpha1/openapi_generated.go @@ -28739,8 +28739,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/openapi_generated.go index bcae369b9..ebb2a3276 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/openapi_generated.go @@ -28851,8 +28851,9 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.Referen Properties: map[string]spec.Schema{ "enabledFeatures": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_db2versions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_db2versions.yaml index bdfc127f8..7d29425f8 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_db2versions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_db2versions.yaml @@ -98,6 +98,7 @@ spec: version: type: string required: + - coordinator - db - version type: object diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_hanadbversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_hanadbversions.yaml index a07d871c4..69f263fd1 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_hanadbversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_hanadbversions.yaml @@ -45,6 +45,13 @@ spec: type: object spec: properties: + coordinator: + properties: + image: + type: string + required: + - image + type: object db: properties: image: @@ -54,8 +61,6 @@ spec: type: object deprecated: type: boolean - endOfLife: - type: boolean securityContext: properties: runAsGroup: @@ -94,6 +99,7 @@ spec: version: type: string required: + - coordinator - db - version type: object diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mariadbversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mariadbversions.yaml index e74503f86..69e884248 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mariadbversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mariadbversions.yaml @@ -245,6 +245,7 @@ spec: version: type: string required: + - coordinator - db - exporter - initContainer diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mssqlserverversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mssqlserverversions.yaml index 0283555a9..02bf36c2c 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mssqlserverversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mssqlserverversions.yaml @@ -218,6 +218,7 @@ spec: version: type: string required: + - coordinator - db - exporter - initContainer diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mysqlversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mysqlversions.yaml index 25b6eef68..740bb8188 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mysqlversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_mysqlversions.yaml @@ -278,6 +278,7 @@ spec: version: type: string required: + - coordinator - db - exporter - initContainer diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_oracleversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_oracleversions.yaml index abade297a..9cf73a0d9 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_oracleversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_oracleversions.yaml @@ -140,6 +140,7 @@ spec: version: type: string required: + - coordinator - db - exporter - version diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_perconaxtradbversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_perconaxtradbversions.yaml index 90376559b..be961015b 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_perconaxtradbversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_perconaxtradbversions.yaml @@ -173,6 +173,7 @@ spec: version: type: string required: + - coordinator - db - exporter - initContainer diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_postgresversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_postgresversions.yaml index 725e50e34..f23e8e3d6 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_postgresversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_postgresversions.yaml @@ -133,6 +133,7 @@ spec: - KubeDB - DocumentDB - PostgreSQL + - Percona type: string endOfLife: type: boolean @@ -270,6 +271,7 @@ spec: version: type: string required: + - coordinator - db - exporter - podSecurityPolicies diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_redisversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_redisversions.yaml index 8facce58e..fe3c9504e 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_redisversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_redisversions.yaml @@ -178,6 +178,7 @@ spec: version: type: string required: + - coordinator - db - exporter - podSecurityPolicies diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_singlestoreversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_singlestoreversions.yaml index bae2dd592..f18192c93 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_singlestoreversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_singlestoreversions.yaml @@ -147,6 +147,7 @@ spec: version: type: string required: + - coordinator - db - version type: object diff --git a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_zookeeperversions.yaml b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_zookeeperversions.yaml index e3691b277..4e69a4a4a 100644 --- a/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_zookeeperversions.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/catalog.kubedb.com_zookeeperversions.yaml @@ -158,6 +158,7 @@ spec: version: type: string required: + - coordinator - db - version type: object diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hanadbs.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hanadbs.yaml index f5d6ad354..75e59c79c 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hanadbs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hanadbs.yaml @@ -3520,6 +3520,24 @@ spec: - Standalone - SystemReplication type: string + systemReplication: + properties: + operationMode: + default: logreplay + enum: + - logreplay + - delta_datashipping + - logreplay_readaccess + type: string + replicationMode: + default: sync + enum: + - sync + - syncmem + - async + - fullsync + type: string + type: object type: object version: type: string diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_neo4jopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_neo4jopsrequests.yaml index 7aa79319e..d9efae190 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_neo4jopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_neo4jopsrequests.yaml @@ -63,9 +63,166 @@ spec: type: object timeout: type: string + tls: + properties: + bolt: + properties: + mode: + enum: + - Disabled + - TLS + - mTLS + type: string + type: object + certificates: + items: + properties: + alias: + type: string + dnsNames: + items: + type: string + type: array + duration: + type: string + emailAddresses: + items: + type: string + type: array + ipAddresses: + items: + type: string + type: array + issuerRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + privateKey: + properties: + encoding: + enum: + - PKCS1 + - PKCS8 + type: string + type: object + renewBefore: + type: string + secretName: + type: string + subject: + properties: + countries: + items: + type: string + type: array + localities: + items: + type: string + type: array + organizationalUnits: + items: + type: string + type: array + organizations: + items: + type: string + type: array + postalCodes: + items: + type: string + type: array + provinces: + items: + type: string + type: array + serialNumber: + type: string + streetAddresses: + items: + type: string + type: array + type: object + uris: + items: + type: string + type: array + required: + - alias + type: object + type: array + cluster: + properties: + mode: + enum: + - Disabled + - TLS + - mTLS + type: string + type: object + http: + properties: + mode: + enum: + - Disabled + - TLS + - mTLS + type: string + type: object + issuerRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + keystoreCredSecret: + properties: + activeFrom: + format: date-time + type: string + apiGroup: + default: "" + type: string + externallyManaged: + type: boolean + kind: + default: Secret + type: string + name: + type: string + rotateAfter: + type: string + secretStoreName: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + remove: + type: boolean + rotateCertificates: + type: boolean + type: object type: enum: - Restart + - ReconfigureTLS type: string required: - databaseRef diff --git a/vendor/kubedb.dev/apimachinery/pkg/utils/raft/client_helpers.go b/vendor/kubedb.dev/apimachinery/pkg/utils/raft/client_helpers.go new file mode 100644 index 000000000..78d2f7442 --- /dev/null +++ b/vendor/kubedb.dev/apimachinery/pkg/utils/raft/client_helpers.go @@ -0,0 +1,121 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package raft + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net" + "net/http" + "strconv" + "strings" + "time" +) + +const ( + DefaultDialContextTimeout = 30 * time.Second + DefaultIdleConnTimeout = 3 * time.Second +) + +type transferLeadershipRequest struct { + Transferee *int `json:"transferee" protobuf:"varint,1,opt,name=transferee"` +} + +func GetRaftHTTPClient() *http.Client { + return &http.Client{ + Transport: &http.Transport{ + IdleConnTimeout: DefaultIdleConnTimeout, + DialContext: (&net.Dialer{ + Timeout: DefaultDialContextTimeout, + }).DialContext, + }, + } +} + +func DoRaftRequest(method, endpoint, user, pass string, body io.Reader, timeout time.Duration) (*http.Response, error) { + client := GetRaftHTTPClient() + req, err := http.NewRequest(method, endpoint, body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", "application/json; charset=UTF-8") + req.SetBasicAuth(user, pass) + + if timeout <= 0 { + timeout = DefaultDialContextTimeout + } + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + req = req.WithContext(ctx) + + return client.Do(req) +} + +func TransferLeadership(endpoint string, transferee int, user, pass string, timeout time.Duration) (string, error) { + transferInfo := transferLeadershipRequest{ + Transferee: &transferee, + } + + requestByte, err := json.Marshal(transferInfo) + if err != nil { + return "", err + } + + resp, err := DoRaftRequest(http.MethodPost, endpoint, user, pass, bytes.NewReader(requestByte), timeout) + if err != nil { + return "", fmt.Errorf("failed to transfer leadership to %d: %w", transferee, err) + } + defer func() { + _ = resp.Body.Close() + }() + + bodyText, err := io.ReadAll(resp.Body) + if err != nil { + return "", fmt.Errorf("failed to transfer leadership to %d: %w", transferee, err) + } + + return string(bodyText), nil +} + +func GetCurrentPrimaryFromLocalhost(coordinatorClientPort int, user, pass string, timeout time.Duration) (int64, error) { + endpoint := fmt.Sprintf("http://127.0.0.1:%d/current-primary", coordinatorClientPort) + + resp, err := DoRaftRequest(http.MethodGet, endpoint, user, pass, nil, timeout) + if err != nil { + return -1, fmt.Errorf("failed to get current primary from localhost: %w", err) + } + defer func() { + _ = resp.Body.Close() + }() + + bodyText, err := io.ReadAll(resp.Body) + if err != nil { + return -1, fmt.Errorf("failed to read current primary response: %w", err) + } + + response := strings.TrimSpace(string(bodyText)) + raftID, err := strconv.ParseInt(response, 10, 64) + if err != nil { + return -1, err + } + + return raftID, nil +} diff --git a/vendor/kubedb.dev/apimachinery/pkg/utils/raft/raft_helpers.go b/vendor/kubedb.dev/apimachinery/pkg/utils/raft/raft_helpers.go new file mode 100644 index 000000000..11b8eaec1 --- /dev/null +++ b/vendor/kubedb.dev/apimachinery/pkg/utils/raft/raft_helpers.go @@ -0,0 +1,271 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package raft + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strconv" + "strings" + "time" + + "kubedb.dev/apimachinery/apis/kubedb" + + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_util "kmodules.xyz/client-go/meta" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const leaderAPIRequestTimeout = DefaultDialContextTimeout + +// DBRaftAddressProvider defines the minimum DB metadata required by raft helpers. +type DBRaftAddressProvider interface { + GoverningServiceDNS(podName string) string + OffshootName() string +} + +type raftNodeInfo struct { + NodeID *int `json:"id" protobuf:"varint,1,opt,name=id"` + URL *string `json:"url,omitempty" protobuf:"bytes,2,opt,name=url"` +} + +// GetCurrentLeaderID queries raft leader id from a coordinator endpoint. +func GetCurrentLeaderID(coordinatorClientPort int, governingDNS string, user, pass string) (uint64, error) { + url := "http://" + governingDNS + ":" + strconv.Itoa(coordinatorClientPort) + "/current-primary" + + defaultLead := uint64(0) + resp, err := DoRaftRequest(http.MethodGet, url, user, pass, nil, leaderAPIRequestTimeout) + if err != nil { + return defaultLead, err + } + defer func() { + _ = resp.Body.Close() + }() + + bodyText, err := io.ReadAll(resp.Body) + if err != nil { + return defaultLead, err + } + + response := strings.TrimSpace(string(bodyText)) + podID, err := strconv.ParseUint(response, 10, 64) + if err != nil { + return defaultLead, err + } + if podID == 0 { + return 0, fmt.Errorf("leader is not elected yet") + } + + return podID, nil +} + +// AddNodeToRaft requests raft membership add via coordinator /add-node endpoint. +func AddNodeToRaft(db DBRaftAddressProvider, coordinatorClientPort, coordinatorPort int, primaryPodName, podName string, nodeID int, user, pass string) (string, error) { + primaryDNSName := db.GoverningServiceDNS(primaryPodName) + primaryURL := "http://" + primaryDNSName + ":" + strconv.Itoa(coordinatorClientPort) + "/add-node" + + dnsName := db.GoverningServiceDNS(podName) + url := "http://" + dnsName + ":" + strconv.Itoa(coordinatorPort) + node := &raftNodeInfo{ + NodeID: &nodeID, + URL: &url, + } + + return doRaftMembershipChange(http.MethodPost, primaryURL, node, user, pass, "add new node") +} + +// RemoveNodeFromRaft requests raft membership remove via coordinator /remove-node endpoint. +func RemoveNodeFromRaft(db DBRaftAddressProvider, coordinatorClientPort int, primaryPodName string, nodeID int, user, pass string) (string, error) { + primaryDNSName := db.GoverningServiceDNS(primaryPodName) + primaryURL := "http://" + primaryDNSName + ":" + strconv.Itoa(coordinatorClientPort) + "/remove-node" + + node := &raftNodeInfo{ + NodeID: &nodeID, + } + + return doRaftMembershipChange(http.MethodDelete, primaryURL, node, user, pass, "remove node") +} + +// GetCurrentLeaderPodName returns current leader pod name by resolving raft leader id. +func GetCurrentLeaderPodName(db DBRaftAddressProvider, coordinatorClientPort int, podName, user, pass string) (string, error) { + leaderID, err := GetCurrentLeaderID(coordinatorClientPort, db.GoverningServiceDNS(podName), user, pass) + if err != nil { + return "", fmt.Errorf("failed on get current primary from remote host: %w", err) + } + if leaderID < 1 { + return "", fmt.Errorf("invalid raft leader id: %d", leaderID) + } + return fmt.Sprintf("%s-%d", db.OffshootName(), leaderID-1), nil +} + +func doRaftMembershipChange(method, endpoint string, node *raftNodeInfo, user, pass, action string) (string, error) { + requestByte, err := json.Marshal(node) + if err != nil { + return "", err + } + requestBody := bytes.NewReader(requestByte) + + resp, err := DoRaftRequest(method, endpoint, user, pass, requestBody, leaderAPIRequestTimeout) + if err != nil { + return "", fmt.Errorf("failed to %s: %w", action, err) + } + defer func() { + _ = resp.Body.Close() + }() + + bodyText, err := io.ReadAll(resp.Body) + if err != nil { + return "", fmt.Errorf("failed to %s: %w", action, err) + } + return string(bodyText), nil +} + +func GetRaftLeaderIDWithRetries(db DBRaftAddressProvider, coordinatorClientPort int, dbPodName, user, pass string, maxTries int, retryDelay time.Duration) (int, error) { + var lastErr error + for tries := 1; tries <= maxTries; tries++ { + currentLeaderID, err := GetCurrentLeaderID(coordinatorClientPort, db.GoverningServiceDNS(dbPodName), user, pass) + if err == nil { + return int(currentLeaderID), nil + } + lastErr = fmt.Errorf("failed on getting current leader: %w", err) + time.Sleep(retryDelay) + } + return 0, fmt.Errorf("failed to get leader of raft cluster: %w", lastErr) +} + +func GetRaftPrimaryNode(db DBRaftAddressProvider, coordinatorClientPort int, replicas int, user, pass string, maxTries int, retryDelay time.Duration) (int, error) { + var lastErr error + for rep := range replicas { + podName := fmt.Sprintf("%s-%v", db.OffshootName(), rep) + primaryPodID, err := GetRaftLeaderIDWithRetries(db, coordinatorClientPort, podName, user, pass, maxTries, retryDelay) + if err == nil { + return primaryPodID, nil + } + lastErr = err + } + return 0, lastErr +} + +func AddRaftNodeWithRetries(db DBRaftAddressProvider, coordinatorClientPort, coordinatorPort int, primaryPodName, podName string, nodeID int, user, pass string, maxTries int, retryDelay time.Duration) error { + var lastErr error + for tries := 0; tries <= maxTries; tries++ { + _, err := AddNodeToRaft(db, coordinatorClientPort, coordinatorPort, primaryPodName, podName, nodeID, user, pass) + if err == nil { + return nil + } + lastErr = err + time.Sleep(retryDelay) + } + return fmt.Errorf("failed to add nodeId = %v to the raft: %w", nodeID, lastErr) +} + +func RemoveRaftNodeWithRetries(db DBRaftAddressProvider, coordinatorClientPort int, primaryPodName string, nodeID int, user, pass string, maxTries int, retryDelay time.Duration) error { + var lastErr error + for tries := 0; tries <= maxTries; tries++ { + _, err := RemoveNodeFromRaft(db, coordinatorClientPort, primaryPodName, nodeID, user, pass) + if err == nil { + return nil + } + lastErr = err + time.Sleep(retryDelay) + } + return fmt.Errorf("failed to remove nodeId = %v from the raft: %w", nodeID, lastErr) +} + +func TransferLeadershipByPodNameWithProvider(db DBRaftAddressProvider, coordinatorClientPort int, podName string, transferee int, user, pass string, timeout time.Duration) (string, error) { + dnsName := db.GoverningServiceDNS(podName) + endpoint := fmt.Sprintf("http://%s:%d/transfer", dnsName, coordinatorClientPort) + return TransferLeadership(endpoint, transferee, user, pass, timeout) +} + +func AddNodeAsVoterWithPodNameWithProvider(db DBRaftAddressProvider, coordinatorClientPort, coordinatorPort int, nodeID int, podName, user, pass string) (string, error) { + primaryPodName, err := GetCurrentLeaderPodName(db, coordinatorClientPort, podName, user, pass) + if err != nil { + return "", fmt.Errorf("failed while trying to make node a voter: %w", err) + } + return AddNodeToRaft(db, coordinatorClientPort, coordinatorPort, primaryPodName, podName, nodeID, user, pass) +} + +func TransferLeadershipByPodName(coordinatorClientPort int, governingDNS string, transferee int, user, pass string, timeout time.Duration) (string, error) { + endpoint := fmt.Sprintf("http://%s:%d/transfer", governingDNS, coordinatorClientPort) + return TransferLeadership(endpoint, transferee, user, pass, timeout) +} + +func AddNodeAsVoterWithPodName(coordinatorClientPort, coordinatorPort int, governingDNS, offshootName string, nodeID int, podName, user, pass string) (string, error) { + leaderID, err := GetCurrentLeaderID(coordinatorClientPort, governingDNS, user, pass) + if err != nil { + return "", fmt.Errorf("failed while trying to make node a voter: %w", err) + } + if leaderID < 1 { + return "", fmt.Errorf("invalid raft leader id: %d", leaderID) + } + + dotIndex := strings.Index(governingDNS, ".") + if dotIndex <= 0 || dotIndex+1 >= len(governingDNS) { + return "", fmt.Errorf("invalid governing DNS: %s", governingDNS) + } + + primaryPodName := fmt.Sprintf("%s-%d", offshootName, leaderID-1) + dnsSuffix := governingDNS[dotIndex:] + primaryDNSName := primaryPodName + dnsSuffix + primaryURL := "http://" + primaryDNSName + ":" + strconv.Itoa(coordinatorClientPort) + "/add-node" + + dnsName := podName + dnsSuffix + url := "http://" + dnsName + ":" + strconv.Itoa(coordinatorPort) + node := &raftNodeInfo{ + NodeID: &nodeID, + URL: &url, + } + + return doRaftMembershipChange(http.MethodPost, primaryURL, node, user, pass, "add new node") +} + +func GetPrimaryPods(cacheClient client.Client, pod *core.Pod, primaryRole string) (*core.PodList, error) { + labelSelector := &metav1.LabelSelector{ + MatchExpressions: []metav1.LabelSelectorRequirement{ + { + Key: kubedb.LabelRole, + Operator: metav1.LabelSelectorOpIn, + Values: []string{primaryRole}, + }, + { + Key: meta_util.InstanceLabelKey, + Operator: metav1.LabelSelectorOpIn, + Values: []string{pod.Labels[meta_util.InstanceLabelKey]}, + }, + { + Key: meta_util.NameLabelKey, + Operator: metav1.LabelSelectorOpIn, + Values: []string{pod.Labels[meta_util.NameLabelKey]}, + }, + }, + } + pods := &core.PodList{} + selector, err := metav1.LabelSelectorAsSelector(labelSelector) + if err != nil { + return nil, fmt.Errorf("failed to build selector for primary pods: %w", err) + } + if err = cacheClient.List(context.TODO(), pods, &client.ListOptions{LabelSelector: selector}); err != nil { + return nil, fmt.Errorf("failed to list primary pods: %w", err) + } + return pods, nil +} diff --git a/vendor/kubedb.dev/apimachinery/pkg/utils/resolve.go b/vendor/kubedb.dev/apimachinery/pkg/utils/resolve.go new file mode 100644 index 000000000..e02458862 --- /dev/null +++ b/vendor/kubedb.dev/apimachinery/pkg/utils/resolve.go @@ -0,0 +1,79 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package utils + +import ( + "bufio" + "fmt" + "os" + "strings" + "sync" + + "k8s.io/klog/v2" +) + +var ( + domain string + once sync.Once +) + +func FindDomain() string { + once.Do(func() { + var err error + domain, err = findDomain() + if err != nil { + klog.Errorf("failed to find domain: %v", err) + domain = "cluster.local" + } + }) + return domain +} + +func findDomain() (string, error) { + filePath := "/etc/resolv.conf" + file, err := os.Open(filePath) + if err != nil { + return "", fmt.Errorf("failed to open %s: %v", filePath, err) + } + defer file.Close() // nolint:errcheck + + scanner := bufio.NewScanner(file) + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) + if line == "" || strings.HasPrefix(line, "#") { + continue + } + if strings.HasPrefix(line, "search ") { + fields := strings.FieldsSeq(line) + // search demo.svc.cluster.local svc.cluster.local cluster.local + // search demo.svc.cluster.local svc.cluster.local cluster.local lan + for field := range fields { + if strings.HasPrefix(field, "svc.") && + !strings.HasPrefix(field, "svc.svc.") { + return strings.TrimPrefix(field, "svc."), nil + } + } + return "", fmt.Errorf("failed to find domain: %s", line) + } + } + + if err := scanner.Err(); err != nil { + return "", fmt.Errorf("error reading %s: %v", filePath, err) + } + + return "", fmt.Errorf("no suitable domain found in %s", filePath) +} diff --git a/vendor/kubedb.dev/apimachinery/pkg/utils/updater.go b/vendor/kubedb.dev/apimachinery/pkg/utils/updater.go new file mode 100644 index 000000000..3bf15fd7e --- /dev/null +++ b/vendor/kubedb.dev/apimachinery/pkg/utils/updater.go @@ -0,0 +1,239 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package utils + +import ( + "context" + "fmt" + "os" + "slices" + "time" + + "github.com/pkg/errors" + core "k8s.io/api/core/v1" + kerr "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/klog/v2" + core_util "kmodules.xyz/client-go/core/v1" + health "kmodules.xyz/client-go/tools/healthchecker" + scutil "kubeops.dev/operator-shard-manager/api/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/event" + "sigs.k8s.io/controller-runtime/pkg/predicate" +) + +const ( + ReadinessGateType = "kubedb.com/conversion" +) + +func UpdateReadinessGateCondition(ctx context.Context, kc client.Client) error { + namespace := os.Getenv("POD_NAMESPACE") + name := os.Getenv("POD_NAME") + var pod core.Pod + err := kc.Get(ctx, client.ObjectKey{Namespace: namespace, Name: name}, &pod) + if err != nil { + return err + } + + foundCondition := false + for i := range pod.Status.Conditions { + if pod.Status.Conditions[i].Type == ReadinessGateType { + pod.Status.Conditions[i].Status = core.ConditionTrue + foundCondition = true + break + } + } + + if !foundCondition { // Add a new condition if not found + pod.Status.Conditions = append(pod.Status.Conditions, core.PodCondition{ + Type: ReadinessGateType, + Status: core.ConditionTrue, + }) + } + + err = kc.Status().Update(context.TODO(), &pod) + if err != nil { + return err + } + + klog.Infoln("Successfully updated the readiness gate condition to True") + return nil +} + +func WaitForShardIdUpdate(kc client.Client, shardConfigName string) { + hostName := os.Getenv("HOSTNAME") + head, err := scutil.FindHeadOfLineage(kc) + if err != nil { + panic(fmt.Sprintf("failed to find the head of the lineage for %v, err: %v", hostName, err)) + } + ticker := time.NewTicker(time.Second) + defer ticker.Stop() + timeout := time.After(5 * time.Minute) + klog.Infof("Waiting for the shard-id to be updated for %v in shardConfig %v \n", hostName, shardConfigName) + for { + select { + case <-timeout: + panic("shardConfig flag provided but no shard object is found with that name") + case <-ticker.C: + pods, err := scutil.GetPodListsFromShardConfig(kc, *head, shardConfigName) + if err != nil { + klog.V(6).Infoln(err.Error()) + continue + } + if slices.Contains(pods, hostName) { + return + } + } + } +} + +type Predicator interface { + GetOwnerObject(obj client.Object) (*unstructured.Unstructured, error) + GetPredicateFuncsForDatabase() predicate.Funcs + GetPredicateFuncsForOwnerObjects() predicate.Funcs +} + +type dbPredicate struct { + kc client.Client + shardConfig string + healthChecker *health.HealthChecker + gvk schema.GroupVersionKind +} + +func NewPredicator(kc client.Client, gvk schema.GroupVersionKind, shardConfig string, healthChecker *health.HealthChecker) Predicator { + return &dbPredicate{ + kc: kc, + shardConfig: shardConfig, + healthChecker: healthChecker, + gvk: gvk, + } +} + +func (p *dbPredicate) GetOwnerObject(obj client.Object) (*unstructured.Unstructured, error) { + ctrl := metav1.GetControllerOf(obj) + if ctrl == nil { + return nil, nil + } + + ok, err := core_util.IsOwnerOfGroupKind(ctrl, p.gvk.Group, p.gvk.Kind) + if err != nil || !ok { + return nil, errors.Wrap(err, fmt.Sprintf("%v/%v is not controlled by %v ", obj.GetNamespace(), obj.GetName(), p.gvk)) + } + + var un unstructured.Unstructured + un.SetGroupVersionKind(schema.GroupVersionKind{ + Group: p.gvk.Group, + Version: p.gvk.Version, + Kind: p.gvk.Kind, + }) + + err = p.kc.Get(context.TODO(), types.NamespacedName{ + Namespace: obj.GetNamespace(), + Name: ctrl.Name, + }, &un) + if err != nil { + return nil, err + } + + return &un, err +} + +func (p *dbPredicate) GetPredicateFuncsForDatabase() predicate.Funcs { + return predicate.Funcs{ + CreateFunc: func(e event.CreateEvent) bool { + obj := e.Object + rq := scutil.ShouldEnqueueObjectForShard(p.kc, p.shardConfig, obj.GetLabels()) + if !rq && p.healthChecker != nil { + p.healthChecker.Stop(obj.GetNamespace() + "/" + obj.GetName()) + } + return rq + }, + + UpdateFunc: func(e event.UpdateEvent) bool { + newObj := e.ObjectNew + rq := scutil.ShouldEnqueueObjectForShard(p.kc, p.shardConfig, newObj.GetLabels()) + if !rq && p.healthChecker != nil { + p.healthChecker.Stop(newObj.GetNamespace() + "/" + newObj.GetName()) + } + return rq + }, + + DeleteFunc: func(e event.DeleteEvent) bool { + obj := e.Object + rq := scutil.ShouldEnqueueObjectForShard(p.kc, p.shardConfig, obj.GetLabels()) + if !rq && p.healthChecker != nil { + p.healthChecker.Stop(obj.GetNamespace() + "/" + obj.GetName()) + } + return rq + }, + } +} + +func (p *dbPredicate) GetPredicateFuncsForOwnerObjects() predicate.Funcs { + return predicate.Funcs{ + CreateFunc: func(e event.CreateEvent) bool { + dbObj, err := p.GetOwnerObject(e.Object) + if err != nil && !kerr.IsNotFound(err) { + klog.Errorln(err) + return false + } + if dbObj == nil { + return false + } + rq := scutil.ShouldEnqueueObjectForShard(p.kc, p.shardConfig, dbObj.GetLabels()) + if !rq && p.healthChecker != nil { + p.healthChecker.Stop(dbObj.GetNamespace() + "/" + dbObj.GetName()) + } + return rq + }, + + UpdateFunc: func(e event.UpdateEvent) bool { + dbObj, err := p.GetOwnerObject(e.ObjectNew) + if err != nil && !kerr.IsNotFound(err) { + klog.Errorln(err) + return false + } + if dbObj == nil { + return false + } + rq := scutil.ShouldEnqueueObjectForShard(p.kc, p.shardConfig, dbObj.GetLabels()) + if !rq && p.healthChecker != nil { + p.healthChecker.Stop(dbObj.GetNamespace() + "/" + dbObj.GetName()) + } + return rq + }, + + DeleteFunc: func(e event.DeleteEvent) bool { + dbObj, err := p.GetOwnerObject(e.Object) + if err != nil && !kerr.IsNotFound(err) { + klog.Errorln(err) + return false + } + if dbObj == nil { + return false + } + rq := scutil.ShouldEnqueueObjectForShard(p.kc, p.shardConfig, dbObj.GetLabels()) + if !rq && p.healthChecker != nil { + p.healthChecker.Stop(dbObj.GetNamespace() + "/" + dbObj.GetName()) + } + return rq + }, + } +} diff --git a/vendor/kubestash.dev/apimachinery/apis/helpers.go b/vendor/kubestash.dev/apimachinery/apis/helpers.go index 58c0dee0b..63e2d9b02 100644 --- a/vendor/kubestash.dev/apimachinery/apis/helpers.go +++ b/vendor/kubestash.dev/apimachinery/apis/helpers.go @@ -17,6 +17,7 @@ limitations under the License. package apis import ( + "maps" "sync" "sigs.k8s.io/controller-runtime/pkg/client" @@ -44,8 +45,6 @@ func UpsertLabels(oldLabels, newLabels map[string]string) map[string]string { if oldLabels == nil { oldLabels = make(map[string]string, len(newLabels)) } - for k, v := range newLabels { - oldLabels[k] = v - } + maps.Copy(oldLabels, newLabels) return oldLabels } diff --git a/vendor/modules.txt b/vendor/modules.txt index 8b8ba6aef..64c112ae3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2548,7 +2548,7 @@ kmodules.xyz/apiversion # kmodules.xyz/cert-manager-util v0.29.0 ## explicit; go 1.21.5 kmodules.xyz/cert-manager-util/certmanager/v1 -# kmodules.xyz/client-go v0.34.2 +# kmodules.xyz/client-go v0.34.3 ## explicit; go 1.24.0 kmodules.xyz/client-go kmodules.xyz/client-go/api/v1 @@ -2566,6 +2566,7 @@ kmodules.xyz/client-go/policy/secomp kmodules.xyz/client-go/policy/v1 kmodules.xyz/client-go/policy/v1beta1 kmodules.xyz/client-go/tools/exec +kmodules.xyz/client-go/tools/healthchecker kmodules.xyz/client-go/tools/portforward # kmodules.xyz/custom-resources v0.34.0 ## explicit; go 1.24.0 @@ -2593,12 +2594,12 @@ kmodules.xyz/offshoot-api/util # kmodules.xyz/prober v0.34.0 ## explicit; go 1.24.0 kmodules.xyz/prober/api/v1 -# kmodules.xyz/resource-metadata v0.42.1 +# kmodules.xyz/resource-metadata v0.42.4 ## explicit; go 1.25 kmodules.xyz/resource-metadata/apis/node kmodules.xyz/resource-metadata/apis/node/v1alpha1 kmodules.xyz/resource-metadata/crds -# kubedb.dev/apimachinery v0.61.0-rc.1 +# kubedb.dev/apimachinery v0.61.0 ## explicit; go 1.25.0 kubedb.dev/apimachinery/apis kubedb.dev/apimachinery/apis/archiver/v1alpha1 @@ -2647,7 +2648,9 @@ kubedb.dev/apimachinery/crds kubedb.dev/apimachinery/pkg/double_optin kubedb.dev/apimachinery/pkg/factory kubedb.dev/apimachinery/pkg/lib -# kubedb.dev/db-client-go v0.16.0-rc.1 +kubedb.dev/apimachinery/pkg/utils +kubedb.dev/apimachinery/pkg/utils/raft +# kubedb.dev/db-client-go v0.16.0 ## explicit; go 1.25.5 kubedb.dev/db-client-go/elasticsearch kubedb.dev/db-client-go/redis @@ -2672,7 +2675,7 @@ kubeops.dev/petset/crds kubeops.dev/sidekick/apis/apps kubeops.dev/sidekick/apis/apps/v1alpha1 kubeops.dev/sidekick/crds -# kubestash.dev/apimachinery v0.24.0-rc.0 +# kubestash.dev/apimachinery v0.24.0 ## explicit; go 1.25.0 kubestash.dev/apimachinery/apis kubestash.dev/apimachinery/apis/core/v1alpha1