diff --git a/go.mod b/go.mod index d6b1330ba..35ef4de25 100644 --- a/go.mod +++ b/go.mod @@ -26,11 +26,11 @@ require ( k8s.io/klog/v2 v2.130.1 k8s.io/kubectl v0.29.0 kmodules.xyz/cert-manager-util v0.29.0 - kmodules.xyz/client-go v0.30.44 + kmodules.xyz/client-go v0.30.45 kmodules.xyz/custom-resources v0.30.0 kmodules.xyz/monitoring-agent-api v0.30.2 - kubedb.dev/apimachinery v0.52.0-rc.0 - kubedb.dev/db-client-go v0.7.0-rc.0 + kubedb.dev/apimachinery v0.52.0 + kubedb.dev/db-client-go v0.7.0 kubeops.dev/petset v0.0.7 sigs.k8s.io/controller-runtime v0.18.4 sigs.k8s.io/yaml v1.4.0 @@ -146,10 +146,10 @@ require ( kmodules.xyz/objectstore-api v0.29.1 // indirect kmodules.xyz/offshoot-api v0.30.1 // indirect kmodules.xyz/prober v0.29.0 // indirect - kmodules.xyz/resource-metadata v0.24.3 // indirect + kmodules.xyz/resource-metadata v0.25.1 // indirect kubeops.dev/csi-driver-cacerts v0.1.0 // indirect kubeops.dev/sidekick v0.0.10 // indirect - kubestash.dev/apimachinery v0.16.0-rc.0 // indirect + kubestash.dev/apimachinery v0.16.0 // indirect sigs.k8s.io/gateway-api v1.1.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kustomize/api v0.17.2 // indirect diff --git a/go.sum b/go.sum index af43cb917..3ca86b88a 100644 --- a/go.sum +++ b/go.sum @@ -717,8 +717,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.30.44 h1:mLOBXQhvCIhdega9WoN4Px/usqobuKTT2vOPQcbGhXQ= -kmodules.xyz/client-go v0.30.44/go.mod h1:T9Kiu20wXEn65dLBQeegf4+y7oahJBR9ZJO2zGEVLIY= +kmodules.xyz/client-go v0.30.45 h1:hSjNlJoPQ86CKS8BiEbSmBkF2+yWsFjjMFISOCVJ6aA= +kmodules.xyz/client-go v0.30.45/go.mod h1:T9Kiu20wXEn65dLBQeegf4+y7oahJBR9ZJO2zGEVLIY= kmodules.xyz/custom-resources v0.30.0 h1:vR3CbseHMLwR4GvtcJJuRuwIV8voKqFqNii27rMcm1o= kmodules.xyz/custom-resources v0.30.0/go.mod h1:ZsTuI2mLG2s3byre7bHmpxJ9w0HDqAkRTL1+izGFI24= kmodules.xyz/monitoring-agent-api v0.30.2 h1:sAgz5P5EXZqhlj1NzJ+QltAgeIx5bGSMj+aYy2EiKaw= @@ -729,20 +729,20 @@ kmodules.xyz/offshoot-api v0.30.1 h1:TrulAYO+oBsXe9sZZGTmNWIuI8qD2izMpgcTSPvgAmI kmodules.xyz/offshoot-api v0.30.1/go.mod h1:T3mpjR6fui0QzOcmQvIuANytW48fe9ytmy/1cgx6D4g= kmodules.xyz/prober v0.29.0 h1:Ex7m4F9rH7uWNNJlLgP63ROOM+nUATJkC2L5OQ7nwMg= kmodules.xyz/prober v0.29.0/go.mod h1:UtK+HKyI1lFLEKX+HFLyOCVju6TO93zv3kwGpzqmKOo= -kmodules.xyz/resource-metadata v0.24.3 h1:yGXm6G1YIXru3mgDqDWsCPhGfotT3xBTKy+jd0bpF+E= -kmodules.xyz/resource-metadata v0.24.3/go.mod h1:rPUZSMR0e1Vi+gONQ2ZhOFW+GvUeK+1AI7h9fzTZoKI= -kubedb.dev/apimachinery v0.52.0-rc.0 h1:9DUShkQGjSINbxgj9/mC2/r6GtFZmJuBOc6RrxzCgB8= -kubedb.dev/apimachinery v0.52.0-rc.0/go.mod h1:5v0QfKvvx9/LasI3561/gIzz9Y9gwmvN3Xm94jdzfMI= -kubedb.dev/db-client-go v0.7.0-rc.0 h1:60XiKyCfOPwUmSpNMOJ4LUyBrKmeRMIxLWBD3PAEFe0= -kubedb.dev/db-client-go v0.7.0-rc.0/go.mod h1:qKTBugyuP+wXn49t7dCVwO8n8ikUPZgmKUpKhr9Eocc= +kmodules.xyz/resource-metadata v0.25.1 h1:iy9/aI03PSx95FYkzHndpa4Zr82V1RFjI24urf1wJ+U= +kmodules.xyz/resource-metadata v0.25.1/go.mod h1:CkIm4CFaYubdvYQeF6xmIVCm2bCYFyvgcXrwcOEWf/o= +kubedb.dev/apimachinery v0.52.0 h1:rX2whAbjVYYOL+vly7qOsWZjMIWskoH/LD1FzSBLJCE= +kubedb.dev/apimachinery v0.52.0/go.mod h1:zoBQg5LAlidAPRpkPBKPR1IYF7dsvyj3Sf84dMpITKo= +kubedb.dev/db-client-go v0.7.0 h1:loX2Kdu28BsV+dCaM5NvLypMIYbuYep47bQSN+YkJkk= +kubedb.dev/db-client-go v0.7.0/go.mod h1:wPlLLYREMUeg0qFyIJ7gfFAu7pVhUbaljZX94PahH8A= kubeops.dev/csi-driver-cacerts v0.1.0 h1:WDgKNo5QAiMoVy4c/4ARWeCXJbqdcXdcn8VLImV4VZU= kubeops.dev/csi-driver-cacerts v0.1.0/go.mod h1:5a/ZOn5LFw26PPBpTKvsivBjcvVArOrJX24C+k+przk= kubeops.dev/petset v0.0.7 h1:F77BTRfUqRVO7kNc8q2oFSSviDmYBqni/osXqu0kgJ4= kubeops.dev/petset v0.0.7/go.mod h1:lt0SZV4ohRy7RiwLNUnMoauG4lCbcRbSqhMg20rdUQg= kubeops.dev/sidekick v0.0.10 h1:/lOT+yV920F6TTPLc7bKR9HLAG/Yx+sTRm1C7rUz744= kubeops.dev/sidekick v0.0.10/go.mod h1:VRyiiKGiJikv/8dNCkrXfkwZCv/2HoIhkmtNurs0gcM= -kubestash.dev/apimachinery v0.16.0-rc.0 h1:J4KrLDZ5NTcwaKsWwQhQNsikSMcIGBUBKfF0NkPp03A= -kubestash.dev/apimachinery v0.16.0-rc.0/go.mod h1:JXx3GmrBhYGq2rt5JWsDOyGoyYHGEz07LuNr1GHq/uo= +kubestash.dev/apimachinery v0.16.0 h1:30ZQQEHaXgNnKFCGN7/LX1cKP/d4sqxC8z/KIBpAVDI= +kubestash.dev/apimachinery v0.16.0/go.mod h1:CnAAQXjAPFhmi41UQwCVIT8s6pv3grSSOqp2kcg0jwY= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM= sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs= diff --git a/vendor/kmodules.xyz/client-go/Makefile b/vendor/kmodules.xyz/client-go/Makefile index 9c7cb06c3..cc30c4757 100644 --- a/vendor/kmodules.xyz/client-go/Makefile +++ b/vendor/kmodules.xyz/client-go/Makefile @@ -261,7 +261,7 @@ lint: $(BUILD_DIRS) --env GO111MODULE=on \ --env GOFLAGS="-mod=vendor" \ $(BUILD_IMAGE) \ - golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --skip-files="generated.*\.go$\" --skip-dirs-use-default + golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default $(BUILD_DIRS): @mkdir -p $@ diff --git a/vendor/kmodules.xyz/client-go/apiextensions/v1/crd.go b/vendor/kmodules.xyz/client-go/apiextensions/v1/crd.go index c6aa7bfc2..dc1eb310c 100644 --- a/vendor/kmodules.xyz/client-go/apiextensions/v1/crd.go +++ b/vendor/kmodules.xyz/client-go/apiextensions/v1/crd.go @@ -115,7 +115,6 @@ func TryUpdateCustomResourceDefinition( klog.Errorf("Attempt %d failed to update CustomResourceDefinition %s due to %v.", attempt, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update CustomResourceDefinition %s after %d attempts due to %v", name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/apps/v1/daemonset.go b/vendor/kmodules.xyz/client-go/apps/v1/daemonset.go index a0f66579b..1ebb66123 100644 --- a/vendor/kmodules.xyz/client-go/apps/v1/daemonset.go +++ b/vendor/kmodules.xyz/client-go/apps/v1/daemonset.go @@ -93,7 +93,6 @@ func TryUpdateDaemonSet(ctx context.Context, c kubernetes.Interface, meta metav1 klog.Errorf("Attempt %d failed to update DaemonSet %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update DaemonSet %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/apps/v1/deployment.go b/vendor/kmodules.xyz/client-go/apps/v1/deployment.go index 941bc4f24..acbaf7c77 100644 --- a/vendor/kmodules.xyz/client-go/apps/v1/deployment.go +++ b/vendor/kmodules.xyz/client-go/apps/v1/deployment.go @@ -97,7 +97,6 @@ func TryUpdateDeployment(ctx context.Context, c kubernetes.Interface, meta metav klog.Errorf("Attempt %d failed to update Deployment %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update Deployment %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/apps/v1/replicaset.go b/vendor/kmodules.xyz/client-go/apps/v1/replicaset.go index ddad60adc..c206e33b8 100644 --- a/vendor/kmodules.xyz/client-go/apps/v1/replicaset.go +++ b/vendor/kmodules.xyz/client-go/apps/v1/replicaset.go @@ -94,7 +94,6 @@ func TryUpdateReplicaSet(ctx context.Context, c kubernetes.Interface, meta metav klog.Errorf("Attempt %d failed to update ReplicaSet %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update ReplicaSet %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/apps/v1/statefulset.go b/vendor/kmodules.xyz/client-go/apps/v1/statefulset.go index 8fd145f81..a6f75eb8b 100644 --- a/vendor/kmodules.xyz/client-go/apps/v1/statefulset.go +++ b/vendor/kmodules.xyz/client-go/apps/v1/statefulset.go @@ -97,7 +97,6 @@ func TryUpdateStatefulSet(ctx context.Context, c kubernetes.Interface, meta meta klog.Errorf("Attempt %d failed to update StatefulSet %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update StatefulSet %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/configmap.go b/vendor/kmodules.xyz/client-go/core/v1/configmap.go index a354b82a8..a05eadd79 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/configmap.go +++ b/vendor/kmodules.xyz/client-go/core/v1/configmap.go @@ -93,7 +93,6 @@ func TryUpdateConfigMap(ctx context.Context, c kubernetes.Interface, meta metav1 klog.Errorf("Attempt %d failed to update ConfigMap %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update ConfigMap %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/events.go b/vendor/kmodules.xyz/client-go/core/v1/events.go index 31e3ea40e..06c61e59c 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/events.go +++ b/vendor/kmodules.xyz/client-go/core/v1/events.go @@ -93,7 +93,6 @@ func TryUpdateEvent(ctx context.Context, c kubernetes.Interface, meta metav1.Obj klog.Errorf("Attempt %d failed to update Event %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update Event %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/node.go b/vendor/kmodules.xyz/client-go/core/v1/node.go index 92642e5bd..47b1b0c65 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/node.go +++ b/vendor/kmodules.xyz/client-go/core/v1/node.go @@ -101,7 +101,6 @@ func TryUpdateNode(ctx context.Context, c kubernetes.Interface, meta metav1.Obje klog.Errorf("Attempt %d failed to update Node %s due to %v.", attempt, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update Node %s after %d attempts due to %v", meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/pod.go b/vendor/kmodules.xyz/client-go/core/v1/pod.go index df8089284..9ef28d812 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/pod.go +++ b/vendor/kmodules.xyz/client-go/core/v1/pod.go @@ -93,7 +93,6 @@ func TryUpdatePod(ctx context.Context, c kubernetes.Interface, meta metav1.Objec klog.Errorf("Attempt %d failed to update Pod %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update Pod %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/pv.go b/vendor/kmodules.xyz/client-go/core/v1/pv.go index 102e9684e..01be9e68c 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/pv.go +++ b/vendor/kmodules.xyz/client-go/core/v1/pv.go @@ -93,7 +93,6 @@ func TryUpdatePV(ctx context.Context, c kubernetes.Interface, meta metav1.Object klog.Errorf("Attempt %d failed to update PersistentVolume %s due to %v.", attempt, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update PersistentVolume %s after %d attempts due to %v", meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/pvc.go b/vendor/kmodules.xyz/client-go/core/v1/pvc.go index 1bd228d80..412f9c911 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/pvc.go +++ b/vendor/kmodules.xyz/client-go/core/v1/pvc.go @@ -93,7 +93,6 @@ func TryUpdatePVC(ctx context.Context, c kubernetes.Interface, meta metav1.Objec klog.Errorf("Attempt %d failed to update PersistentVolumeClaim %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update PersistentVolumeClaim %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/rc.go b/vendor/kmodules.xyz/client-go/core/v1/rc.go index 6f7fa20b3..46bd25d77 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/rc.go +++ b/vendor/kmodules.xyz/client-go/core/v1/rc.go @@ -94,7 +94,6 @@ func TryUpdateRC(ctx context.Context, c kubernetes.Interface, meta metav1.Object klog.Errorf("Attempt %d failed to update ReplicationController %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update ReplicationController %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/secret.go b/vendor/kmodules.xyz/client-go/core/v1/secret.go index 058a5c36d..1c5bdd2f8 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/secret.go +++ b/vendor/kmodules.xyz/client-go/core/v1/secret.go @@ -117,7 +117,6 @@ func TryUpdateSecret(ctx context.Context, c kubernetes.Interface, meta metav1.Ob klog.Errorf("Attempt %d failed to update Secret %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update Secret %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/service.go b/vendor/kmodules.xyz/client-go/core/v1/service.go index 88e639960..d09950230 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/service.go +++ b/vendor/kmodules.xyz/client-go/core/v1/service.go @@ -93,7 +93,6 @@ func TryUpdateService(ctx context.Context, c kubernetes.Interface, meta metav1.O klog.Errorf("Attempt %d failed to update Service %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update Service %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/client-go/core/v1/serviceaccount.go b/vendor/kmodules.xyz/client-go/core/v1/serviceaccount.go index 3d08a625f..4a57e11d6 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/serviceaccount.go +++ b/vendor/kmodules.xyz/client-go/core/v1/serviceaccount.go @@ -93,7 +93,6 @@ func TryUpdateServiceAccount(ctx context.Context, c kubernetes.Interface, meta m klog.Errorf("Attempt %d failed to update ServiceAccount %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) return false, nil }) - if err != nil { err = errors.Errorf("failed to update ServiceAccount %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) } diff --git a/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresources.yaml b/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresources.yaml index 607554959..631e0dadd 100644 --- a/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresources.yaml +++ b/vendor/kmodules.xyz/resource-metadata/crds/core.k8s.appscode.com_genericresources.yaml @@ -144,6 +144,28 @@ spec: type: string name: type: string + namespace: + properties: + aceOrgID: + type: string + aceOrgMetadata: + additionalProperties: + type: string + type: object + creationTimestamp: + format: date-time + type: string + name: + type: string + uid: + description: UID is a type that holds unique ID values, including + UUIDs. Because we don't ONLY use UUIDs, this is an alias to + string. Being a type captures intent and helps make sure that + UIDs and names do not get conflated. + type: string + required: + - name + type: object pods: items: properties: diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go index 8b0fb31fb..cb71903e1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go @@ -1696,7 +1696,7 @@ var ( }, } - // DefaultResourcesMemoryIntensive must be used for elasticsearch + // DefaultResourcesMemoryIntensive must be used for elasticsearch or kafka // to avoid OOMKILLED while deploying ES V8 DefaultResourcesMemoryIntensive = core.ResourceRequirements{ Requests: core.ResourceList{ diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_helpers.go index dcf426865..e89f959d5 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_helpers.go @@ -357,7 +357,7 @@ func (k *Kafka) SetDefaults() { dbContainer := coreutil.GetContainerByName(k.Spec.Topology.Controller.PodTemplate.Spec.Containers, kubedb.KafkaContainerName) if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) { - apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResources) + apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResourcesMemoryIntensive) } } @@ -372,7 +372,7 @@ func (k *Kafka) SetDefaults() { dbContainer := coreutil.GetContainerByName(k.Spec.Topology.Broker.PodTemplate.Spec.Containers, kubedb.KafkaContainerName) if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) { - apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResources) + apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResourcesMemoryIntensive) } } } else { @@ -383,7 +383,7 @@ func (k *Kafka) SetDefaults() { dbContainer := coreutil.GetContainerByName(k.Spec.PodTemplate.Spec.Containers, kubedb.KafkaContainerName) if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) { - apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResources) + apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResourcesMemoryIntensive) } } k.SetDefaultEnvs() diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_helpers.go index e3c36e1fb..3e281d7c3 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_helpers.go @@ -286,6 +286,18 @@ func (m *MariaDB) SetDefaults(mdVersion *v1alpha1.MariaDBVersion) { if m.IsCluster() && m.IsMariaDBReplication() { m.SetDefaultsMaxscale(mdVersion, m.Spec.Topology.MaxScale) } + + if m.Spec.Init != nil && m.Spec.Init.Archiver != nil { + if m.Spec.Init.Archiver.EncryptionSecret != nil && m.Spec.Init.Archiver.EncryptionSecret.Namespace == "" { + m.Spec.Init.Archiver.EncryptionSecret.Namespace = m.GetNamespace() + } + if m.Spec.Init.Archiver.FullDBRepository != nil && m.Spec.Init.Archiver.FullDBRepository.Namespace == "" { + m.Spec.Init.Archiver.FullDBRepository.Namespace = m.GetNamespace() + } + if m.Spec.Init.Archiver.ManifestRepository != nil && m.Spec.Init.Archiver.ManifestRepository.Namespace == "" { + m.Spec.Init.Archiver.ManifestRepository.Namespace = m.GetNamespace() + } + } } func (m *MariaDB) SetDefaultsMaxscale(mdVersion *v1alpha1.MariaDBVersion, maxscale *MaxScaleSpec) { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_helpers.go index 60fc7f8c8..5f71609f9 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_helpers.go @@ -681,6 +681,18 @@ func (m *MongoDB) SetDefaults(mgVersion *v1alpha1.MongoDBVersion) { m.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = mgVersion.Spec.SecurityContext.RunAsGroup } } + + if m.Spec.Init != nil && m.Spec.Init.Archiver != nil { + if m.Spec.Init.Archiver.EncryptionSecret != nil && m.Spec.Init.Archiver.EncryptionSecret.Namespace == "" { + m.Spec.Init.Archiver.EncryptionSecret.Namespace = m.GetNamespace() + } + if m.Spec.Init.Archiver.FullDBRepository != nil && m.Spec.Init.Archiver.FullDBRepository.Namespace == "" { + m.Spec.Init.Archiver.FullDBRepository.Namespace = m.GetNamespace() + } + if m.Spec.Init.Archiver.ManifestRepository != nil && m.Spec.Init.Archiver.ManifestRepository.Namespace == "" { + m.Spec.Init.Archiver.ManifestRepository.Namespace = m.GetNamespace() + } + } } func (m *MongoDB) initializePodTemplates() { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_helpers.go index 87c27aae7..1aeac59cf 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_helpers.go @@ -320,6 +320,18 @@ func (m *MySQL) SetDefaults(myVersion *v1alpha1.MySQLVersion) { if m.Spec.Init != nil && m.Spec.Init.Archiver != nil && m.Spec.Init.Archiver.ReplicationStrategy == nil { m.Spec.Init.Archiver.ReplicationStrategy = ptr.To(ReplicationStrategyNone) } + + if m.Spec.Init != nil && m.Spec.Init.Archiver != nil { + if m.Spec.Init.Archiver.EncryptionSecret != nil && m.Spec.Init.Archiver.EncryptionSecret.Namespace == "" { + m.Spec.Init.Archiver.EncryptionSecret.Namespace = m.GetNamespace() + } + if m.Spec.Init.Archiver.FullDBRepository != nil && m.Spec.Init.Archiver.FullDBRepository.Namespace == "" { + m.Spec.Init.Archiver.FullDBRepository.Namespace = m.GetNamespace() + } + if m.Spec.Init.Archiver.ManifestRepository != nil && m.Spec.Init.Archiver.ManifestRepository.Namespace == "" { + m.Spec.Init.Archiver.ManifestRepository.Namespace = m.GetNamespace() + } + } } func (m *MySQL) SetTLSDefaults() { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_helpers.go index 63512dfb2..55be8e866 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_helpers.go @@ -32,10 +32,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" + "k8s.io/utils/ptr" kmapi "kmodules.xyz/client-go/api/v1" "kmodules.xyz/client-go/apiextensions" core_util "kmodules.xyz/client-go/core/v1" meta_util "kmodules.xyz/client-go/meta" + "kmodules.xyz/client-go/policy/secomp" appcat "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1" mona "kmodules.xyz/monitoring-agent-api/api/v1" ofstv2 "kmodules.xyz/offshoot-api/api/v2" @@ -224,20 +226,21 @@ func (p *PgBouncer) SetDefaults(pgBouncerVersion *catalog.PgBouncerVersion, uses } } - p.setPgBouncerContainerDefaults(&p.Spec.PodTemplate) + p.setPgBouncerContainerDefaults(&p.Spec.PodTemplate, pgBouncerVersion) + p.setDefaultPodSecurityContext() - p.SetSecurityContext(pgBouncerVersion) if p.Spec.TLS != nil { p.SetTLSDefaults(usesAcme) } p.Spec.Monitor.SetDefaults() + if p.Spec.Monitor != nil && p.Spec.Monitor.Prometheus != nil { if p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser == nil { - p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser = pgBouncerVersion.Spec.SecurityContext.RunAsUser + p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser = pointer.Int64P(*pgBouncerVersion.Spec.SecurityContext.RunAsUser) } if p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup == nil { - p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = pgBouncerVersion.Spec.SecurityContext.RunAsUser + p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = pointer.Int64P(*pgBouncerVersion.Spec.SecurityContext.RunAsUser) } } dbContainer := core_util.GetContainerByName(p.Spec.PodTemplate.Spec.Containers, ResourceSingularPgBouncer) @@ -246,12 +249,13 @@ func (p *PgBouncer) SetDefaults(pgBouncerVersion *catalog.PgBouncerVersion, uses } } -func (p *PgBouncer) setPgBouncerContainerDefaults(podTemplate *ofstv2.PodTemplateSpec) { +func (p *PgBouncer) setPgBouncerContainerDefaults(podTemplate *ofstv2.PodTemplateSpec, pbVersion *catalog.PgBouncerVersion) { if podTemplate == nil { return } container := ofst_util.EnsureContainerExists(podTemplate, kubedb.PgBouncerContainerName) p.setContainerDefaultResources(container, *kubedb.DefaultResources.DeepCopy()) + p.SetContainerDefaultSecurityContext(container, pbVersion) } func (p *PgBouncer) setContainerDefaultResources(container *core.Container, defaultResources core.ResourceRequirements) { @@ -320,59 +324,56 @@ func (p *PgBouncer) SetHealthCheckerDefaults() { } } -func (p *PgBouncer) SetSecurityContext(pgBouncerVersion *catalog.PgBouncerVersion) { - container := core_util.GetContainerByName(p.Spec.PodTemplate.Spec.Containers, kubedb.PgBouncerContainerName) - if container == nil { - container = &core.Container{ +func (p *PgBouncer) setDefaultPodSecurityContext() { + pbContainer := core_util.GetContainerByName(p.Spec.PodTemplate.Spec.Containers, kubedb.PgBouncerContainerName) + if pbContainer == nil { + pbContainer = &core.Container{ Name: kubedb.PgBouncerContainerName, } } + if p.Spec.PodTemplate.Spec.SecurityContext == nil { + p.Spec.PodTemplate.Spec.SecurityContext = &core.PodSecurityContext{} + } + if p.Spec.PodTemplate.Spec.SecurityContext.RunAsUser == nil { + p.Spec.PodTemplate.Spec.SecurityContext.RunAsUser = ptr.To(*pbContainer.SecurityContext.RunAsUser) + } + if p.Spec.PodTemplate.Spec.SecurityContext.RunAsGroup == nil { + p.Spec.PodTemplate.Spec.SecurityContext.RunAsGroup = ptr.To(*pbContainer.SecurityContext.RunAsGroup) + } + if p.Spec.PodTemplate.Spec.SecurityContext.FSGroup == nil { + p.Spec.PodTemplate.Spec.SecurityContext.FSGroup = ptr.To(*pbContainer.SecurityContext.RunAsGroup) + } +} + +func (p *PgBouncer) SetContainerDefaultSecurityContext(container *core.Container, pbVersion *catalog.PgBouncerVersion) { if container.SecurityContext == nil { - container.SecurityContext = &core.SecurityContext{ - RunAsUser: func() *int64 { - if p.Spec.PodTemplate.Spec.SecurityContext == nil || p.Spec.PodTemplate.Spec.SecurityContext.RunAsUser == nil { - return pgBouncerVersion.Spec.SecurityContext.RunAsUser - } - return p.Spec.PodTemplate.Spec.SecurityContext.RunAsUser - }(), - RunAsGroup: func() *int64 { - if p.Spec.PodTemplate.Spec.SecurityContext == nil || p.Spec.PodTemplate.Spec.SecurityContext.RunAsGroup == nil { - return pgBouncerVersion.Spec.SecurityContext.RunAsUser - } - return p.Spec.PodTemplate.Spec.SecurityContext.RunAsGroup - }(), - Privileged: pointer.BoolP(false), - } - } else { - if container.SecurityContext.RunAsUser == nil { - container.SecurityContext.RunAsUser = pgBouncerVersion.Spec.SecurityContext.RunAsUser - } - if container.SecurityContext.RunAsGroup == nil { - container.SecurityContext.RunAsGroup = container.SecurityContext.RunAsUser + container.SecurityContext = &core.SecurityContext{} + } + if container.SecurityContext.RunAsUser == nil { + container.SecurityContext.RunAsUser = pointer.Int64P(70) + if pbVersion.Spec.SecurityContext.RunAsUser != nil { + container.SecurityContext.RunAsUser = pbVersion.Spec.SecurityContext.RunAsUser } } - if p.Spec.PodTemplate.Spec.SecurityContext == nil { - p.Spec.PodTemplate.Spec.SecurityContext = &core.PodSecurityContext{ - RunAsUser: container.SecurityContext.RunAsUser, - RunAsGroup: container.SecurityContext.RunAsGroup, - } - } else { - if p.Spec.PodTemplate.Spec.SecurityContext.RunAsUser == nil { - p.Spec.PodTemplate.Spec.SecurityContext.RunAsUser = container.SecurityContext.RunAsUser - } - if p.Spec.PodTemplate.Spec.SecurityContext.RunAsGroup == nil { - p.Spec.PodTemplate.Spec.SecurityContext.RunAsGroup = container.SecurityContext.RunAsGroup - } + if container.SecurityContext.RunAsGroup == nil { + // running as root, we gave all the required permissions in dockerFile + container.SecurityContext.RunAsGroup = pointer.Int64P(0) } - // Need to set FSGroup equal to p.Spec.PodTemplate.Spec.ContainerSecurityContext.RunAsGroup. - // So that /var/pv directory have the group permission for the RunAsGroup user GID. - // Otherwise, We will get write permission denied. - p.Spec.PodTemplate.Spec.SecurityContext.FSGroup = container.SecurityContext.RunAsGroup - isPgbouncerContainerPresent := core_util.GetContainerByName(p.Spec.PodTemplate.Spec.Containers, kubedb.PgBouncerContainerName) - if isPgbouncerContainerPresent == nil { - core_util.UpsertContainer(p.Spec.PodTemplate.Spec.Containers, *container) + allowPrivilegeEscalation := pointer.Bool(container.SecurityContext.AllowPrivilegeEscalation) + container.SecurityContext.AllowPrivilegeEscalation = &allowPrivilegeEscalation + + if container.SecurityContext.Capabilities == nil { + container.SecurityContext.Capabilities = &core.Capabilities{ + Drop: []core.Capability{"ALL"}, + } + } + if container.SecurityContext.RunAsNonRoot == nil { + container.SecurityContext.RunAsNonRoot = ptr.To(true) + } + if container.SecurityContext.SeccompProfile == nil { + container.SecurityContext.SeccompProfile = secomp.DefaultSeccompProfile() } } 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 81857ce6b..ba9c77dfd 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go @@ -255,10 +255,10 @@ func (p *Postgres) SetDefaults(postgresVersion *catalog.PostgresVersion) { } } - p.setDefaultPodSecurityContext(&p.Spec.PodTemplate, postgresVersion) - p.setPostgresContainerDefaults(&p.Spec.PodTemplate, postgresVersion) - p.setCoordinatorContainerDefaults(&p.Spec.PodTemplate, postgresVersion) - p.setInitContainerDefaults(&p.Spec.PodTemplate, postgresVersion) + p.SetDefaultPodSecurityContext(&p.Spec.PodTemplate, postgresVersion) + p.SetPostgresContainerDefaults(&p.Spec.PodTemplate, postgresVersion) + p.SetCoordinatorContainerDefaults(&p.Spec.PodTemplate, postgresVersion) + p.SetInitContainerDefaults(&p.Spec.PodTemplate, postgresVersion) // Need to set FSGroup equal to p.Spec.PodTemplate.Spec.ContainerSecurityContext.RunAsGroup. // So that /var/pv directory have the group permission for the RunAsGroup user GID. @@ -280,6 +280,18 @@ 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) } + + if p.Spec.Init != nil && p.Spec.Init.Archiver != nil { + if p.Spec.Init.Archiver.EncryptionSecret != nil && p.Spec.Init.Archiver.EncryptionSecret.Namespace == "" { + p.Spec.Init.Archiver.EncryptionSecret.Namespace = p.GetNamespace() + } + if p.Spec.Init.Archiver.FullDBRepository != nil && p.Spec.Init.Archiver.FullDBRepository.Namespace == "" { + p.Spec.Init.Archiver.FullDBRepository.Namespace = p.GetNamespace() + } + if p.Spec.Init.Archiver.ManifestRepository != nil && p.Spec.Init.Archiver.ManifestRepository.Namespace == "" { + p.Spec.Init.Archiver.ManifestRepository.Namespace = p.GetNamespace() + } + } } func getMajorPgVersion(postgresVersion *catalog.PostgresVersion) (uint64, error) { @@ -324,7 +336,7 @@ func (p *Postgres) SetArbiterDefault() { } } -func (p *Postgres) setDefaultPodSecurityContext(podTemplate *ofstv2.PodTemplateSpec, pgVersion *catalog.PostgresVersion) { +func (p *Postgres) SetDefaultPodSecurityContext(podTemplate *ofstv2.PodTemplateSpec, pgVersion *catalog.PostgresVersion) { if podTemplate == nil { return } @@ -343,7 +355,7 @@ func (p *Postgres) setDefaultPodSecurityContext(podTemplate *ofstv2.PodTemplateS } } -func (p *Postgres) setInitContainerDefaults(podTemplate *ofstv2.PodTemplateSpec, pgVersion *catalog.PostgresVersion) { +func (p *Postgres) SetInitContainerDefaults(podTemplate *ofstv2.PodTemplateSpec, pgVersion *catalog.PostgresVersion) { if podTemplate == nil { return } @@ -352,7 +364,7 @@ func (p *Postgres) setInitContainerDefaults(podTemplate *ofstv2.PodTemplateSpec, p.setContainerDefaultResources(container, *kubedb.DefaultInitContainerResource.DeepCopy()) } -func (p *Postgres) setPostgresContainerDefaults(podTemplate *ofstv2.PodTemplateSpec, pgVersion *catalog.PostgresVersion) { +func (p *Postgres) SetPostgresContainerDefaults(podTemplate *ofstv2.PodTemplateSpec, pgVersion *catalog.PostgresVersion) { if podTemplate == nil { return } @@ -361,7 +373,7 @@ func (p *Postgres) setPostgresContainerDefaults(podTemplate *ofstv2.PodTemplateS p.setContainerDefaultResources(container, *kubedb.DefaultResources.DeepCopy()) } -func (p *Postgres) setCoordinatorContainerDefaults(podTemplate *ofstv2.PodTemplateSpec, pgVersion *catalog.PostgresVersion) { +func (p *Postgres) SetCoordinatorContainerDefaults(podTemplate *ofstv2.PodTemplateSpec, pgVersion *catalog.PostgresVersion) { if podTemplate == nil { return } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_helpers.go index e3a6e3078..06c3b1b4a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_helpers.go @@ -650,6 +650,16 @@ func (d *Druid) GetDefaultPVC() *core.PersistentVolumeClaimSpec { } func (d *Druid) setDefaultContainerSecurityContext(druidVersion *catalog.DruidVersion, podTemplate *ofst.PodTemplateSpec) { + if podTemplate == nil { + return + } + if podTemplate.Spec.SecurityContext == nil { + podTemplate.Spec.SecurityContext = &v1.PodSecurityContext{} + } + if podTemplate.Spec.SecurityContext.FSGroup == nil { + podTemplate.Spec.SecurityContext.FSGroup = druidVersion.Spec.SecurityContext.RunAsUser + } + container := coreutil.GetContainerByName(podTemplate.Spec.Containers, kubedb.DruidContainerName) if container == nil { container = &v1.Container{ diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ferretdb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ferretdb_helpers.go index b88bb0459..e776ce8d2 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ferretdb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ferretdb_helpers.go @@ -117,7 +117,7 @@ func (f *FerretDB) GetAuthSecretName() string { func (f *FerretDB) GetPersistentSecrets() []string { var secrets []string if f.Spec.AuthSecret != nil { - secrets = append(secrets, f.Spec.AuthSecret.Name) + secrets = append(secrets, f.GetAuthSecretName()) } return secrets } @@ -244,7 +244,7 @@ func (f *FerretDB) SetDefaults() { } } - defaultVersion := "13.13" + defaultVersion := "16.4-bookworm" if !f.Spec.Backend.ExternallyManaged { if f.Spec.Backend.Version == nil { f.Spec.Backend.Version = &defaultVersion diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_helpers.go index 9553a57a8..3f2610ba0 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_helpers.go @@ -409,6 +409,18 @@ func (m *MSSQLServer) SetDefaults() { m.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = mssqlVersion.Spec.SecurityContext.RunAsUser } } + + if m.Spec.Init != nil && m.Spec.Init.Archiver != nil { + if m.Spec.Init.Archiver.EncryptionSecret != nil && m.Spec.Init.Archiver.EncryptionSecret.Namespace == "" { + m.Spec.Init.Archiver.EncryptionSecret.Namespace = m.GetNamespace() + } + if m.Spec.Init.Archiver.FullDBRepository != nil && m.Spec.Init.Archiver.FullDBRepository.Namespace == "" { + m.Spec.Init.Archiver.FullDBRepository.Namespace = m.GetNamespace() + } + if m.Spec.Init.Archiver.ManifestRepository != nil && m.Spec.Init.Archiver.ManifestRepository.Namespace == "" { + m.Spec.Init.Archiver.ManifestRepository.Namespace = m.GetNamespace() + } + } } func (m *MSSQLServer) setDefaultContainerSecurityContext(mssqlVersion *catalog.MSSQLServerVersion, podTemplate *ofst.PodTemplateSpec) { 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 839140570..fa2f68570 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go @@ -35052,7 +35052,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_SolrSpec(ref common.ReferenceCallb "zookeeperRef": { SchemaProps: spec.SchemaProps{ Description: "\t// ZooKeeper contains information for Solr to store configurations for collections", - Ref: ref("kmodules.xyz/client-go/api/v1.ObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ZookeeperRef"), }, }, "solrModules": { @@ -35186,7 +35186,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_SolrSpec(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SolrClusterTopology"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SolrClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ZookeeperRef"}, } } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_helpers.go index c37ccd3b5..260ee018f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_helpers.go @@ -272,6 +272,34 @@ func (s Solr) CoordinatorSelectors() map[string]string { return s.OffshootSelectors(map[string]string{string(SolrNodeRoleCoordinator): SolrNodeRoleSet}) } +func (s *Solr) SetDefaultsToZooKeeperRef() { + if s.Spec.ZookeeperRef == nil { + s.Spec.ZookeeperRef = &ZookeeperRef{} + } + s.SetZooKeeperObjectRef() + if s.Spec.ZookeeperRef.Version == nil { + defaultVersion := "3.7.2" + s.Spec.ZookeeperRef.Version = &defaultVersion + } +} + +func (s *Solr) GetZooKeeperName() string { + return s.OffshootName() + "-zk" +} + +func (s *Solr) SetZooKeeperObjectRef() { + if s.Spec.ZookeeperRef.ObjectReference == nil { + s.Spec.ZookeeperRef.ObjectReference = &kmapi.ObjectReference{} + } + if s.Spec.ZookeeperRef.Name == "" { + s.Spec.ZookeeperRef.ExternallyManaged = false + s.Spec.ZookeeperRef.Name = s.GetZooKeeperName() + } + if s.Spec.ZookeeperRef.Namespace == "" { + s.Spec.ZookeeperRef.Namespace = s.Namespace + } +} + func (s *Solr) SetDefaults() { if s.Spec.DeletionPolicy == "" { s.Spec.DeletionPolicy = DeletionPolicyDelete @@ -285,6 +313,9 @@ func (s *Solr) SetDefaults() { s.Spec.StorageType = StorageTypeDurable } + s.SetDefaultsToZooKeeperRef() + s.SetZooKeeperObjectRef() + if s.Spec.ZookeeperDigestSecret == nil { s.Spec.ZookeeperDigestSecret = &v1.LocalObjectReference{ Name: s.SolrSecretName("zk-digest"), @@ -320,10 +351,6 @@ func (s *Solr) SetDefaults() { if s.Spec.Topology.Data.Replicas == nil { s.Spec.Topology.Data.Replicas = pointer.Int32P(1) } - if s.Spec.Topology.Data.PodTemplate.Spec.SecurityContext == nil { - s.Spec.Topology.Data.PodTemplate.Spec.SecurityContext = &v1.PodSecurityContext{} - } - s.Spec.Topology.Data.PodTemplate.Spec.SecurityContext.FSGroup = slVersion.Spec.SecurityContext.RunAsUser s.setDefaultContainerSecurityContext(&slVersion, &s.Spec.Topology.Data.PodTemplate) s.setDefaultContainerResourceLimits(&s.Spec.Topology.Data.PodTemplate) @@ -336,10 +363,6 @@ func (s *Solr) SetDefaults() { if s.Spec.Topology.Overseer.Replicas == nil { s.Spec.Topology.Overseer.Replicas = pointer.Int32P(1) } - if s.Spec.Topology.Overseer.PodTemplate.Spec.SecurityContext == nil { - s.Spec.Topology.Overseer.PodTemplate.Spec.SecurityContext = &v1.PodSecurityContext{} - } - s.Spec.Topology.Overseer.PodTemplate.Spec.SecurityContext.FSGroup = slVersion.Spec.SecurityContext.RunAsUser s.setDefaultContainerSecurityContext(&slVersion, &s.Spec.Topology.Overseer.PodTemplate) s.setDefaultContainerResourceLimits(&s.Spec.Topology.Overseer.PodTemplate) } @@ -351,10 +374,6 @@ func (s *Solr) SetDefaults() { if s.Spec.Topology.Coordinator.Replicas == nil { s.Spec.Topology.Coordinator.Replicas = pointer.Int32P(1) } - if s.Spec.Topology.Coordinator.PodTemplate.Spec.SecurityContext == nil { - s.Spec.Topology.Coordinator.PodTemplate.Spec.SecurityContext = &v1.PodSecurityContext{} - } - s.Spec.Topology.Coordinator.PodTemplate.Spec.SecurityContext.FSGroup = slVersion.Spec.SecurityContext.RunAsUser s.setDefaultContainerSecurityContext(&slVersion, &s.Spec.Topology.Coordinator.PodTemplate) s.setDefaultContainerResourceLimits(&s.Spec.Topology.Coordinator.PodTemplate) } @@ -362,10 +381,6 @@ func (s *Solr) SetDefaults() { if s.Spec.Replicas == nil { s.Spec.Replicas = pointer.Int32P(1) } - if s.Spec.PodTemplate.Spec.SecurityContext == nil { - s.Spec.PodTemplate.Spec.SecurityContext = &v1.PodSecurityContext{} - } - s.Spec.PodTemplate.Spec.SecurityContext.FSGroup = slVersion.Spec.SecurityContext.RunAsUser s.setDefaultContainerSecurityContext(&slVersion, &s.Spec.PodTemplate) s.setDefaultContainerResourceLimits(&s.Spec.PodTemplate) } @@ -384,6 +399,15 @@ func (s *Solr) SetDefaults() { } func (s *Solr) setDefaultContainerSecurityContext(slVersion *catalog.SolrVersion, podTemplate *ofst.PodTemplateSpec) { + if podTemplate == nil { + return + } + if podTemplate.Spec.SecurityContext == nil { + podTemplate.Spec.SecurityContext = &v1.PodSecurityContext{} + } + if podTemplate.Spec.SecurityContext.FSGroup == nil { + podTemplate.Spec.SecurityContext.FSGroup = slVersion.Spec.SecurityContext.RunAsUser + } initContainer := coreutil.GetContainerByName(podTemplate.Spec.InitContainers, kubedb.SolrInitContainerName) if initContainer == nil { initContainer = &v1.Container{ diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_types.go index cb8cc875a..b08c38ed4 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_types.go @@ -72,7 +72,7 @@ type SolrSpec struct { Storage *core.PersistentVolumeClaimSpec `json:"storage,omitempty"` // // ZooKeeper contains information for Solr to store configurations for collections - ZookeeperRef *kmapi.ObjectReference `json:"zookeeperRef,omitempty"` + ZookeeperRef *ZookeeperRef `json:"zookeeperRef,omitempty"` // +optional SolrModules []string `json:"solrModules,omitempty"` 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 5c20fa3fe..11f8236ac 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 @@ -5692,8 +5692,8 @@ func (in *SolrSpec) DeepCopyInto(out *SolrSpec) { } if in.ZookeeperRef != nil { in, out := &in.ZookeeperRef, &out.ZookeeperRef - *out = new(apiv1.ObjectReference) - **out = **in + *out = new(ZookeeperRef) + (*in).DeepCopyInto(*out) } if in.SolrModules != nil { in, out := &in.SolrModules, &out.SolrModules diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go index 0dd262681..860f5b488 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go @@ -309,6 +309,42 @@ const ( RestartPrimary = "RestartPrimary" RestartSecondary = "RestartSecondary" + + StartRunScript = "StartRunScriptWithRestart" + KillRunScript = "KillRunScript" + StickyLeader = "STICKYLEADER" // We want a id(sticky id) to be always leader in raft + UpdateDataDirectory = "UpdateDataDirectory" + PausePgCoordinatorBeforeUpgrade = "PausePgCoordinatorBeforeUpdate" + RunningLeaderSticky = "RunningLeaderSticky" + EnsureStickyId = "EnsureStickyId" + SetPrimaryPodNameInStatus = "SetPrimaryPodNameInStatus" + NonTransferableResumeAfterUpgrade = "NonTransferableResumeAfterUpgrade" + PausePgCoordinatorBeforeCustomRestart = "PausePgCoordinatorBeforeCustomRestart" + NonTransferableResumeAfterCustomRestart = "NonTransferableResumeAfterCustomRestart" + ReadyPrimaryCheck = "ReadyPrimaryCheck" + PrimaryPodName = "PrimaryPodName" + OpsRequestProgressing = "OpsRequestProgressing" + SetRaftKeyOpsRequestProgressing = "SetRaftKeyOpsRequestProgressing" + UnsetRaftKeyOpsRequestProgressing = "UnsetRaftKeyOpsRequestProgressing" + NotReadyReplicas = "NotReadyReplicas" + RestartNotReadyStandby = "RestartNotReadyStandby" + StandbyReadyCheck = "StandbyReadyCheck" + PrimaryRunningCheck = "PrimaryRunningCheck" + StopPostgresServer = "StopPostgresServer" + SetupRecoverySettings = "SetupRecoverySettings" + RunPostgresBaseBackup = "RunPostgresBaseBackup" + StartPostgresRecovery = "StartPostgresRecovery" + RestartNotReadyStandbyAfterBaseBackup = "RestartNotReadyStandbyAfterBaseBackup" + StandbyReadyCheckAfterBaseBackup = "StandbyReadyCheckAfterBaseBackup" + ReconnectStandbyWithRestart = "ReconnectStandbyWithRestart" + ReconnectStandbyWithBaseBackup = "ReconnectStandbyWithBaseBackup" + UpdateRaftKVStore = "UpdateRaftKVStore" + CreateFailOverFile = "CreateFailOverFile" + TransitionCandidateToLeader = "TransitionCandidateToLeader" + ForceFailOverFileName = "force-failover-with-lsn" + // need reveiw about this two + StringFalse = "false" + StringTrue = "true" ) // Redis Constants 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 85df45281..9b1452c72 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go @@ -636,10 +636,13 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.PodResources": schema_apimachinery_apis_ops_v1alpha1_PodResources(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresCustomConfiguration": schema_apimachinery_apis_ops_v1alpha1_PostgresCustomConfiguration(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresCustomConfigurationSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresForceFailOver": schema_apimachinery_apis_ops_v1alpha1_PostgresForceFailOver(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresOpsRequest": schema_apimachinery_apis_ops_v1alpha1_PostgresOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_PostgresOpsRequestList(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresOpsRequestSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresOpsRequestSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresReconnectStandby": schema_apimachinery_apis_ops_v1alpha1_PostgresReconnectStandby(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresSetRaftKeyPair": schema_apimachinery_apis_ops_v1alpha1_PostgresSetRaftKeyPair(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresTLSSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresTLSSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresVerticalScalingSpec(ref), @@ -31414,6 +31417,32 @@ func schema_apimachinery_apis_ops_v1alpha1_PostgresCustomConfigurationSpec(ref c } } +func schema_apimachinery_apis_ops_v1alpha1_PostgresForceFailOver(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "candidates": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + func schema_apimachinery_apis_ops_v1alpha1_PostgresHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -31612,6 +31641,24 @@ func schema_apimachinery_apis_ops_v1alpha1_PostgresOpsRequestSpec(ref common.Ref Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"), }, }, + "reconnectStandby": { + SchemaProps: spec.SchemaProps{ + Description: "Try to reconnect standby's with primary", + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresReconnectStandby"), + }, + }, + "forceFailOver": { + SchemaProps: spec.SchemaProps{ + Description: "Forcefully do a failover to the given candidate", + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresForceFailOver"), + }, + }, + "setRaftKeyPair": { + SchemaProps: spec.SchemaProps{ + Description: "Set given key pairs to raft storage", + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresSetRaftKeyPair"), + }, + }, "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.", @@ -31630,7 +31677,54 @@ func schema_apimachinery_apis_ops_v1alpha1_PostgresOpsRequestSpec(ref common.Ref }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresVolumeExpansionSpec", "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.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresForceFailOver", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresReconnectStandby", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresSetRaftKeyPair", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_PostgresReconnectStandby(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "readyTimeOut": { + SchemaProps: spec.SchemaProps{ + Description: "ReadyTimeOut is the time to wait for standby`s to become ready", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_PostgresSetRaftKeyPair(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "keyPair": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, } } diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types.go index bc2839490..42854892a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types.go @@ -84,6 +84,12 @@ type PostgresOpsRequestSpec struct { Authentication *AuthSpec `json:"authentication,omitempty"` // Specifies information necessary for restarting database Restart *RestartSpec `json:"restart,omitempty"` + // Try to reconnect standby's with primary + ReconnectStandby *PostgresReconnectStandby `json:"reconnectStandby,omitempty"` + // Forcefully do a failover to the given candidate + ForceFailOver *PostgresForceFailOver `json:"forceFailOver,omitempty"` + // Set given key pairs to raft storage + SetRaftKeyPair *PostgresSetRaftKeyPair `json:"setRaftKeyPair,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. @@ -91,8 +97,8 @@ type PostgresOpsRequestSpec struct { Apply ApplyOption `json:"apply,omitempty"` } -// +kubebuilder:validation:Enum=Upgrade;UpdateVersion;HorizontalScaling;VerticalScaling;VolumeExpansion;Restart;Reconfigure;ReconfigureTLS;RotateAuth -// ENUM(UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS, RotateAuth) +// +kubebuilder:validation:Enum=Upgrade;UpdateVersion;HorizontalScaling;VerticalScaling;VolumeExpansion;Restart;Reconfigure;ReconfigureTLS;RotateAuth;ReconnectStandby;ForceFailOver;SetRaftKeyPair +// ENUM(UpdateVersion, HorizontalScaling, VerticalScaling, VolumeExpansion, Restart, Reconfigure, ReconfigureTLS, RotateAuth, ReconnectStandby, ForceFailOver, SetRaftKeyPair) type PostgresOpsRequestType string type PostgresUpdateVersionSpec struct { @@ -116,11 +122,13 @@ const ( WarmPostgresStandbyMode PostgresStandbyMode = "Warm" ) +type PostgresPrimaryCandidate string + // HorizontalScaling is the spec for Postgres horizontal scaling type PostgresHorizontalScalingSpec struct { Replicas *int32 `json:"replicas,omitempty"` // Standby mode - // +kubebuilder:default="Warm" + // +kubebuilder:default="Hot" StandbyMode *PostgresStandbyMode `json:"standbyMode,omitempty"` // Streaming mode @@ -156,6 +164,20 @@ type PostgresCustomConfiguration struct { Remove bool `json:"remove,omitempty"` } +type PostgresReconnectStandby struct { + // ReadyTimeOut is the time to wait for standby`s to become ready + // +optional + ReadyTimeOut *metav1.Duration `json:"readyTimeOut,omitempty"` +} + +type PostgresForceFailOver struct { + Candidates []PostgresPrimaryCandidate `json:"candidates,omitempty"` +} + +type PostgresSetRaftKeyPair struct { + KeyPair map[string]string `json:"keyPair,omitempty"` +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PostgresOpsRequestList is a list of PostgresOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types_enum.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types_enum.go index e9dbf8951..505ab9729 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types_enum.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types_enum.go @@ -28,6 +28,12 @@ const ( PostgresOpsRequestTypeReconfigureTLS PostgresOpsRequestType = "ReconfigureTLS" // PostgresOpsRequestTypeRotateAuth is a PostgresOpsRequestType of type RotateAuth. PostgresOpsRequestTypeRotateAuth PostgresOpsRequestType = "RotateAuth" + // PostgresOpsRequestTypeReconnectStandby is a PostgresOpsRequestType of type ReconnectStandby. + PostgresOpsRequestTypeReconnectStandby PostgresOpsRequestType = "ReconnectStandby" + // PostgresOpsRequestTypeForceFailOver is a PostgresOpsRequestType of type ForceFailOver. + PostgresOpsRequestTypeForceFailOver PostgresOpsRequestType = "ForceFailOver" + // PostgresOpsRequestTypeSetRaftKeyPair is a PostgresOpsRequestType of type SetRaftKeyPair. + PostgresOpsRequestTypeSetRaftKeyPair PostgresOpsRequestType = "SetRaftKeyPair" ) var ErrInvalidPostgresOpsRequestType = fmt.Errorf("not a valid PostgresOpsRequestType, try [%s]", strings.Join(_PostgresOpsRequestTypeNames, ", ")) @@ -41,6 +47,9 @@ var _PostgresOpsRequestTypeNames = []string{ string(PostgresOpsRequestTypeReconfigure), string(PostgresOpsRequestTypeReconfigureTLS), string(PostgresOpsRequestTypeRotateAuth), + string(PostgresOpsRequestTypeReconnectStandby), + string(PostgresOpsRequestTypeForceFailOver), + string(PostgresOpsRequestTypeSetRaftKeyPair), } // PostgresOpsRequestTypeNames returns a list of possible string values of PostgresOpsRequestType. @@ -61,6 +70,9 @@ func PostgresOpsRequestTypeValues() []PostgresOpsRequestType { PostgresOpsRequestTypeReconfigure, PostgresOpsRequestTypeReconfigureTLS, PostgresOpsRequestTypeRotateAuth, + PostgresOpsRequestTypeReconnectStandby, + PostgresOpsRequestTypeForceFailOver, + PostgresOpsRequestTypeSetRaftKeyPair, } } @@ -85,6 +97,9 @@ var _PostgresOpsRequestTypeValue = map[string]PostgresOpsRequestType{ "Reconfigure": PostgresOpsRequestTypeReconfigure, "ReconfigureTLS": PostgresOpsRequestTypeReconfigureTLS, "RotateAuth": PostgresOpsRequestTypeRotateAuth, + "ReconnectStandby": PostgresOpsRequestTypeReconnectStandby, + "ForceFailOver": PostgresOpsRequestTypeForceFailOver, + "SetRaftKeyPair": PostgresOpsRequestTypeSetRaftKeyPair, } // ParsePostgresOpsRequestType attempts to convert a string to a PostgresOpsRequestType. 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 486797d2f..8de759a92 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 @@ -4228,6 +4228,27 @@ func (in *PostgresCustomConfigurationSpec) DeepCopy() *PostgresCustomConfigurati return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgresForceFailOver) DeepCopyInto(out *PostgresForceFailOver) { + *out = *in + if in.Candidates != nil { + in, out := &in.Candidates, &out.Candidates + *out = make([]PostgresPrimaryCandidate, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresForceFailOver. +func (in *PostgresForceFailOver) DeepCopy() *PostgresForceFailOver { + if in == nil { + return nil + } + out := new(PostgresForceFailOver) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PostgresHorizontalScalingSpec) DeepCopyInto(out *PostgresHorizontalScalingSpec) { *out = *in @@ -4364,6 +4385,21 @@ func (in *PostgresOpsRequestSpec) DeepCopyInto(out *PostgresOpsRequestSpec) { *out = new(RestartSpec) **out = **in } + if in.ReconnectStandby != nil { + in, out := &in.ReconnectStandby, &out.ReconnectStandby + *out = new(PostgresReconnectStandby) + (*in).DeepCopyInto(*out) + } + if in.ForceFailOver != nil { + in, out := &in.ForceFailOver, &out.ForceFailOver + *out = new(PostgresForceFailOver) + (*in).DeepCopyInto(*out) + } + if in.SetRaftKeyPair != nil { + in, out := &in.SetRaftKeyPair, &out.SetRaftKeyPair + *out = new(PostgresSetRaftKeyPair) + (*in).DeepCopyInto(*out) + } if in.Timeout != nil { in, out := &in.Timeout, &out.Timeout *out = new(metav1.Duration) @@ -4382,6 +4418,50 @@ func (in *PostgresOpsRequestSpec) DeepCopy() *PostgresOpsRequestSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgresReconnectStandby) DeepCopyInto(out *PostgresReconnectStandby) { + *out = *in + if in.ReadyTimeOut != nil { + in, out := &in.ReadyTimeOut, &out.ReadyTimeOut + *out = new(metav1.Duration) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresReconnectStandby. +func (in *PostgresReconnectStandby) DeepCopy() *PostgresReconnectStandby { + if in == nil { + return nil + } + out := new(PostgresReconnectStandby) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgresSetRaftKeyPair) DeepCopyInto(out *PostgresSetRaftKeyPair) { + *out = *in + if in.KeyPair != nil { + in, out := &in.KeyPair, &out.KeyPair + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresSetRaftKeyPair. +func (in *PostgresSetRaftKeyPair) DeepCopy() *PostgresSetRaftKeyPair { + if in == nil { + return nil + } + out := new(PostgresSetRaftKeyPair) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PostgresTLSSpec) DeepCopyInto(out *PostgresTLSSpec) { *out = *in diff --git a/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/database_connection_types.go b/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/database_connection_types.go index 9112d4248..0ee091244 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/database_connection_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/database_connection_types.go @@ -43,42 +43,17 @@ type DatabaseConnection struct { // DatabaseConnectionSpec defines the desired state of DatabaseConnection type DatabaseConnectionSpec struct { - Gateway []GatewayConnection `json:"gateway,omitempty"` + Public []PublicInfo `json:"public,omitempty"` InCluster InClusterConnection `json:"inCluster,omitempty"` // Databases already present on the referred database server Databases []string `json:"databases,omitempty"` - - // Parameters: `username = \n - // password = \n - // host = \n - // database = \n - // sslmode = REQUIRED` - // - // URI: `mongodb+srv://:@:/?authSource=&tls=true&replicaSet=arnob` - // - // Flags: `mongo "mongodb+srv://:@:/?authSource=&replicaSet=arnob" --tls` - // - // And some language specific template strings. Like: Java, C#, Go, Python, Javascript, Ruby etc. - ConnectOptions map[string]string `json:"connectOptions,omitempty"` } -//type ConnectOption struct { -// // username = -// // password = -// // host = -// // database = -// // sslmode = REQUIRED -// Parameters []string `json:"parameters,omitempty"` -// -// // Actual: mongodb+srv://doadmin:show-password@arnob-a013a268.mongo.ondigitalocean.com/admin?authSource=admin&tls=true&replicaSet=arnob -// // Template: `mongodb+srv://:@:/?authSource=&tls=true&replicaSet=arnob` -// ConnectionString string `json:"connectionString,omitempty"` -// -// // Actual: mongo "mongodb+srv://doadmin:show-password@private-arnob-aa409eb4.mongo.ondigitalocean.com/admin?authSource=admin&replicaSet=arnob" --tls -// // Template: `mongo "mongodb+srv://:@:/?authSource=&replicaSet=arnob" --tls` -// Flags string `json:"flags,omitempty"` -//} +type PublicInfo struct { + Gateway []GatewayConnection `json:"gateway,omitempty"` + ConnectOptions map[string]string `json:"connectOptions,omitempty"` +} type GatewayConnection struct { *ofst.Gateway `json:",inline"` @@ -94,6 +69,19 @@ type InClusterConnection struct { Exec string `json:"exec,omitempty"` SecretRef *kmapi.ObjectReference `json:"secretRef,omitempty"` CACert []byte `json:"caCert,omitempty"` + + // Parameters: `username = \n + // password = \n + // host = \n + // database = \n + // sslmode = REQUIRED` + // + // URI: `mongodb+srv://:@:/?authSource=&tls=true&replicaSet=arnob` + // + // Flags: `mongo "mongodb+srv://:@:/?authSource=&replicaSet=arnob" --tls` + // + // And some language specific template strings. Like: Java, C#, Go, Python, Javascript, Ruby etc. + ConnectOptions map[string]string `json:"connectOptions,omitempty"` } // DatabaseConnectionList contains a list of DatabaseConnection 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 7b887af50..9c3ba71ad 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/openapi_generated.go @@ -615,6 +615,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ui/v1alpha1.ProxySQLSettingsList": schema_apimachinery_apis_ui_v1alpha1_ProxySQLSettingsList(ref), "kubedb.dev/apimachinery/apis/ui/v1alpha1.ProxySQLSettingsSpec": schema_apimachinery_apis_ui_v1alpha1_ProxySQLSettingsSpec(ref), "kubedb.dev/apimachinery/apis/ui/v1alpha1.ProxySQLSlowQuerySpec": schema_apimachinery_apis_ui_v1alpha1_ProxySQLSlowQuerySpec(ref), + "kubedb.dev/apimachinery/apis/ui/v1alpha1.PublicInfo": schema_apimachinery_apis_ui_v1alpha1_PublicInfo(ref), "kubedb.dev/apimachinery/apis/ui/v1alpha1.RedisDatabaseSpec": schema_apimachinery_apis_ui_v1alpha1_RedisDatabaseSpec(ref), "kubedb.dev/apimachinery/apis/ui/v1alpha1.RedisInsight": schema_apimachinery_apis_ui_v1alpha1_RedisInsight(ref), "kubedb.dev/apimachinery/apis/ui/v1alpha1.RedisInsightList": schema_apimachinery_apis_ui_v1alpha1_RedisInsightList(ref), @@ -25646,14 +25647,14 @@ func schema_apimachinery_apis_ui_v1alpha1_DatabaseConnectionSpec(ref common.Refe Description: "DatabaseConnectionSpec defines the desired state of DatabaseConnection", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "gateway": { + "public": { SchemaProps: spec.SchemaProps{ Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("kubedb.dev/apimachinery/apis/ui/v1alpha1.GatewayConnection"), + Ref: ref("kubedb.dev/apimachinery/apis/ui/v1alpha1.PublicInfo"), }, }, }, @@ -25680,27 +25681,11 @@ func schema_apimachinery_apis_ui_v1alpha1_DatabaseConnectionSpec(ref common.Refe }, }, }, - "connectOptions": { - SchemaProps: spec.SchemaProps{ - Description: "Parameters: `username = \n password = \n host = \n database = \n sslmode = REQUIRED`\n\nURI: `mongodb+srv://:@:/?authSource=&tls=true&replicaSet=arnob`\n\nFlags: `mongo \"mongodb+srv://:@:/?authSource=&replicaSet=arnob\" --tls`\n\nAnd some language specific template strings. Like: Java, C#, Go, Python, Javascript, Ruby etc.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, }, }, }, Dependencies: []string{ - "kubedb.dev/apimachinery/apis/ui/v1alpha1.GatewayConnection", "kubedb.dev/apimachinery/apis/ui/v1alpha1.InClusterConnection"}, + "kubedb.dev/apimachinery/apis/ui/v1alpha1.InClusterConnection", "kubedb.dev/apimachinery/apis/ui/v1alpha1.PublicInfo"}, } } @@ -26548,6 +26533,22 @@ func schema_apimachinery_apis_ui_v1alpha1_InClusterConnection(ref common.Referen Format: "byte", }, }, + "connectOptions": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters: `username = \n password = \n host = \n database = \n sslmode = REQUIRED`\n\nURI: `mongodb+srv://:@:/?authSource=&tls=true&replicaSet=arnob`\n\nFlags: `mongo \"mongodb+srv://:@:/?authSource=&replicaSet=arnob\" --tls`\n\nAnd some language specific template strings. Like: Java, C#, Go, Python, Javascript, Ruby etc.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, }, }, }, @@ -31897,6 +31898,48 @@ func schema_apimachinery_apis_ui_v1alpha1_ProxySQLSlowQuerySpec(ref common.Refer } } +func schema_apimachinery_apis_ui_v1alpha1_PublicInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "gateway": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/ui/v1alpha1.GatewayConnection"), + }, + }, + }, + }, + }, + "connectOptions": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "kubedb.dev/apimachinery/apis/ui/v1alpha1.GatewayConnection"}, + } +} + func schema_apimachinery_apis_ui_v1alpha1_RedisDatabaseSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/zz_generated.deepcopy.go b/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/zz_generated.deepcopy.go index 7de3b860b..98a1367d1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kubedb.dev/apimachinery/apis/ui/v1alpha1/zz_generated.deepcopy.go @@ -92,9 +92,9 @@ func (in *DatabaseConnectionList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseConnectionSpec) DeepCopyInto(out *DatabaseConnectionSpec) { *out = *in - if in.Gateway != nil { - in, out := &in.Gateway, &out.Gateway - *out = make([]GatewayConnection, len(*in)) + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = make([]PublicInfo, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -105,13 +105,6 @@ func (in *DatabaseConnectionSpec) DeepCopyInto(out *DatabaseConnectionSpec) { *out = make([]string, len(*in)) copy(*out, *in) } - if in.ConnectOptions != nil { - in, out := &in.ConnectOptions, &out.ConnectOptions - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } return } @@ -626,6 +619,13 @@ func (in *InClusterConnection) DeepCopyInto(out *InClusterConnection) { *out = make([]byte, len(*in)) copy(*out, *in) } + if in.ConnectOptions != nil { + in, out := &in.ConnectOptions, &out.ConnectOptions + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } return } @@ -3777,6 +3777,36 @@ func (in *ProxySQLSlowQuerySpec) DeepCopy() *ProxySQLSlowQuerySpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicInfo) DeepCopyInto(out *PublicInfo) { + *out = *in + if in.Gateway != nil { + in, out := &in.Gateway, &out.Gateway + *out = make([]GatewayConnection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ConnectOptions != nil { + in, out := &in.ConnectOptions, &out.ConnectOptions + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicInfo. +func (in *PublicInfo) DeepCopy() *PublicInfo { + if in == nil { + return nil + } + out := new(PublicInfo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RedisDatabaseSpec) DeepCopyInto(out *RedisDatabaseSpec) { *out = *in diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_solrs.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_solrs.yaml index 38c0f4e1c..0b8d66d7e 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_solrs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_solrs.yaml @@ -13158,10 +13158,16 @@ spec: x-kubernetes-map-type: atomic zookeeperRef: properties: + externallyManaged: + type: boolean name: type: string namespace: type: string + pathsBase: + type: string + version: + type: string required: - name type: object diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_postgresopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_postgresopsrequests.yaml index b9a1ee909..f5a5c509c 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_postgresopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_postgresopsrequests.yaml @@ -81,13 +81,20 @@ spec: type: string type: object x-kubernetes-map-type: atomic + forceFailOver: + properties: + candidates: + items: + type: string + type: array + type: object horizontalScaling: properties: replicas: format: int32 type: integer standbyMode: - default: Warm + default: Hot enum: - Hot - Warm @@ -99,8 +106,20 @@ spec: - Asynchronous type: string type: object + reconnectStandby: + properties: + readyTimeOut: + type: string + type: object restart: type: object + setRaftKeyPair: + properties: + keyPair: + additionalProperties: + type: string + type: object + type: object timeout: type: string tls: @@ -234,6 +253,9 @@ spec: - Reconfigure - ReconfigureTLS - RotateAuth + - ReconnectStandby + - ForceFailOver + - SetRaftKeyPair type: string updateVersion: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ui.kubedb.com_databaseconnections.yaml b/vendor/kubedb.dev/apimachinery/crds/ui.kubedb.com_databaseconnections.yaml index 1c70ff8e6..f96d13a8f 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ui.kubedb.com_databaseconnections.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ui.kubedb.com_databaseconnections.yaml @@ -26,111 +26,19 @@ spec: type: object spec: properties: - connectOptions: - additionalProperties: - type: string - type: object databases: items: type: string type: array - gateway: - items: - properties: - caCert: - format: byte - type: string - hostname: - type: string - ip: - type: string - name: - type: string - namespace: - type: string - secretRef: - properties: - name: - type: string - namespace: - type: string - required: - - name - type: object - services: - items: - properties: - alias: - type: string - ports: - items: - properties: - backendServicePort: - format: int32 - type: integer - name: - type: string - nodePort: - format: int32 - type: integer - port: - format: int32 - type: integer - required: - - port - type: object - type: array - required: - - alias - - ports - type: object - type: array - ui: - items: - properties: - alias: - type: string - helmRelease: - properties: - name: - default: "" - type: string - type: object - x-kubernetes-map-type: atomic - port: - properties: - backendServicePort: - format: int32 - type: integer - name: - type: string - nodePort: - format: int32 - type: integer - port: - format: int32 - type: integer - required: - - port - type: object - url: - type: string - required: - - alias - - port - - url - type: object - type: array - required: - - name - - namespace - type: object - type: array inCluster: properties: caCert: format: byte type: string + connectOptions: + additionalProperties: + type: string + type: object exec: type: string host: @@ -148,6 +56,107 @@ spec: - name type: object type: object + public: + items: + properties: + connectOptions: + additionalProperties: + type: string + type: object + gateway: + items: + properties: + caCert: + format: byte + type: string + hostname: + type: string + ip: + type: string + name: + type: string + namespace: + type: string + secretRef: + properties: + name: + type: string + namespace: + type: string + required: + - name + type: object + services: + items: + properties: + alias: + type: string + ports: + items: + properties: + backendServicePort: + format: int32 + type: integer + name: + type: string + nodePort: + format: int32 + type: integer + port: + format: int32 + type: integer + required: + - port + type: object + type: array + required: + - alias + - ports + type: object + type: array + ui: + items: + properties: + alias: + type: string + helmRelease: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + port: + properties: + backendServicePort: + format: int32 + type: integer + name: + type: string + nodePort: + format: int32 + type: integer + port: + format: int32 + type: integer + required: + - port + type: object + url: + type: string + required: + - alias + - port + - url + type: object + type: array + required: + - name + - namespace + type: object + type: array + type: object + type: array type: object status: properties: diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/api.go b/vendor/kubedb.dev/db-client-go/elasticsearch/api.go index 93b9b6fa9..a0ee43cf5 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/api.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/api.go @@ -92,6 +92,7 @@ type ESClient interface { GetDBUserRole(ctx context.Context) (error, bool) IndexExistsOrNot(index string) error NodesStats() (map[string]interface{}, error) + ShardStats() ([]ShardInfo, error) PutData(index, id string, data map[string]interface{}) error SyncCredentialFromSecret(secret *core.Secret) error } diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/client.go b/vendor/kubedb.dev/db-client-go/elasticsearch/client.go index 2e04bbb62..d3dec8804 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/client.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/client.go @@ -26,3 +26,11 @@ type ESRestyClient struct { Client *resty.Client Config *Config } + +type ShardInfo struct { + Index string `json:"index,omitempty"` + Shard string `json:"shard,omitempty"` + Prirep string `json:"prirep,omitempty"` + State string `json:"state,omitempty"` + UnassignedReason string `json:"unassigned.reason,omitempty"` +} diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v5.go b/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v5.go index ffb69e25e..af882e20c 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v5.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v5.go @@ -42,6 +42,10 @@ func (es *ESClientV5) NodesStats() (map[string]interface{}, error) { return nil, nil } +func (es *ESClientV5) ShardStats() ([]ShardInfo, error) { + return nil, nil +} + // GetIndicesInfo will return the indices info of an Elasticsearch database func (es *ESClientV5) GetIndicesInfo() ([]interface{}, error) { return nil, nil diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v6.go b/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v6.go index e8486c2f3..5e427e23d 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v6.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v6.go @@ -20,6 +20,7 @@ import ( "context" "encoding/json" "fmt" + "io" "net/http" "strings" @@ -60,6 +61,34 @@ func (es *ESClientV6) NodesStats() (map[string]interface{}, error) { return nil, nil } +func (es *ESClientV6) ShardStats() ([]ShardInfo, error) { + req := esapi.CatShardsRequest{ + Bytes: "b", + Format: "json", + Pretty: true, + Human: true, + H: []string{"index", "shard", "prirep", "state", "unassigned.reason"}, + } + + resp, err := req.Do(context.Background(), es.client) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println("Error reading body:", err) + } + + var shardStats []ShardInfo + err = json.Unmarshal(body, &shardStats) + if err != nil { + return nil, err + } + return shardStats, nil +} + // GetIndicesInfo will return the indices info of an Elasticsearch database func (es *ESClientV6) GetIndicesInfo() ([]interface{}, error) { req := esapi.CatIndicesRequest{ diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v7.go b/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v7.go index 6decadeb5..851ff3bd7 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v7.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v7.go @@ -77,6 +77,34 @@ func (es *ESClientV7) NodesStats() (map[string]interface{}, error) { return nodesStats, nil } +func (es *ESClientV7) ShardStats() ([]ShardInfo, error) { + req := esapi.CatShardsRequest{ + Bytes: "b", + Format: "json", + Pretty: true, + Human: true, + H: []string{"index", "shard", "prirep", "state", "unassigned.reason"}, + } + + resp, err := req.Do(context.Background(), es.client) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println("Error reading body:", err) + } + + var shardStats []ShardInfo + err = json.Unmarshal(body, &shardStats) + if err != nil { + return nil, err + } + return shardStats, nil +} + // GetIndicesInfo will return the indices info of an Elasticsearch database func (es *ESClientV7) GetIndicesInfo() ([]interface{}, error) { req := esapi.CatIndicesRequest{ diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v8.go b/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v8.go index 8ec1cc9ae..b7489ed96 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v8.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/es_client_v8.go @@ -77,6 +77,34 @@ func (es *ESClientV8) NodesStats() (map[string]interface{}, error) { return nodesStats, nil } +func (es *ESClientV8) ShardStats() ([]ShardInfo, error) { + req := esapi.CatShardsRequest{ + Bytes: "b", + Format: "json", + Pretty: true, + Human: true, + H: []string{"index", "shard", "prirep", "state", "unassigned.reason"}, + } + + resp, err := req.Do(context.Background(), es.client) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println("Error reading body:", err) + } + + var shardStats []ShardInfo + err = json.Unmarshal(body, &shardStats) + if err != nil { + return nil, err + } + return shardStats, nil +} + // GetIndicesInfo will return the indices' info of an Elasticsearch database func (es *ESClientV8) GetIndicesInfo() ([]interface{}, error) { req := esapi.CatIndicesRequest{ diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v1.go b/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v1.go index 672907f9e..0206d5f98 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v1.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v1.go @@ -76,6 +76,34 @@ func (os *OSClientV1) NodesStats() (map[string]interface{}, error) { return nodesStats, nil } +func (es *OSClientV1) ShardStats() ([]ShardInfo, error) { + req := opensearchapi.CatShardsRequest{ + Bytes: "b", + Format: "json", + Pretty: true, + Human: true, + H: []string{"index", "shard", "prirep", "state", "unassigned.reason"}, + } + + resp, err := req.Do(context.Background(), es.client) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println("Error reading body:", err) + } + + var shardStats []ShardInfo + err = json.Unmarshal(body, &shardStats) + if err != nil { + return nil, err + } + return shardStats, nil +} + // GetIndicesInfo will return the indices' info of an Elasticsearch database func (os *OSClientV1) GetIndicesInfo() ([]interface{}, error) { req := opensearchapi.CatIndicesRequest{ diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v2.go b/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v2.go index aaa5b7986..df84c8d58 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v2.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v2.go @@ -77,6 +77,34 @@ func (os *OSClientV2) NodesStats() (map[string]interface{}, error) { return nodesStats, nil } +func (es *OSClientV2) ShardStats() ([]ShardInfo, error) { + req := osv2api.CatShardsRequest{ + Bytes: "b", + Format: "json", + Pretty: true, + Human: true, + H: []string{"index", "shard", "prirep", "state", "unassigned.reason"}, + } + + resp, err := req.Do(context.Background(), es.client) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println("Error reading body:", err) + } + + var shardStats []ShardInfo + err = json.Unmarshal(body, &shardStats) + if err != nil { + return nil, err + } + return shardStats, nil +} + // GetIndicesInfo will return the indices' info of an Elasticsearch database func (os *OSClientV2) GetIndicesInfo() ([]interface{}, error) { req := osv2api.CatIndicesRequest{ diff --git a/vendor/modules.txt b/vendor/modules.txt index 12984e121..f985614a3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1467,7 +1467,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.30.44 +# kmodules.xyz/client-go v0.30.45 ## explicit; go 1.22.0 kmodules.xyz/client-go kmodules.xyz/client-go/api/v1 @@ -1509,12 +1509,12 @@ kmodules.xyz/offshoot-api/util # kmodules.xyz/prober v0.29.0 ## explicit; go 1.21.5 kmodules.xyz/prober/api/v1 -# kmodules.xyz/resource-metadata v0.24.3 +# kmodules.xyz/resource-metadata v0.25.1 ## explicit; go 1.22.1 kmodules.xyz/resource-metadata/apis/node kmodules.xyz/resource-metadata/apis/node/v1alpha1 kmodules.xyz/resource-metadata/crds -# kubedb.dev/apimachinery v0.52.0-rc.0 +# kubedb.dev/apimachinery v0.52.0 ## explicit; go 1.22.1 kubedb.dev/apimachinery/apis kubedb.dev/apimachinery/apis/archiver/v1alpha1 @@ -1558,7 +1558,7 @@ kubedb.dev/apimachinery/crds kubedb.dev/apimachinery/pkg/double_optin kubedb.dev/apimachinery/pkg/factory kubedb.dev/apimachinery/pkg/validator -# kubedb.dev/db-client-go v0.7.0-rc.0 +# kubedb.dev/db-client-go v0.7.0 ## explicit; go 1.22.1 kubedb.dev/db-client-go/elasticsearch kubedb.dev/db-client-go/redis @@ -1581,7 +1581,7 @@ kubeops.dev/petset/pkg/features kubeops.dev/sidekick/apis/apps kubeops.dev/sidekick/apis/apps/v1alpha1 kubeops.dev/sidekick/crds -# kubestash.dev/apimachinery v0.16.0-rc.0 +# kubestash.dev/apimachinery v0.16.0 ## explicit; go 1.22.1 kubestash.dev/apimachinery/apis kubestash.dev/apimachinery/apis/core/v1alpha1