Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ require (
k8s.io/klog/v2 v2.130.1
kmodules.xyz/client-go v0.32.1
kmodules.xyz/custom-resources v0.32.0
kubedb.dev/apimachinery v0.53.0-rc.1
kubedb.dev/apimachinery v0.53.0
sigs.k8s.io/controller-runtime v0.20.3
xorm.io/xorm v1.3.6
)
Expand Down Expand Up @@ -138,13 +138,13 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.32.3 // indirect
k8s.io/kube-openapi v0.0.0-20250318172550-b98be4ee1595 // indirect
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect
kmodules.xyz/apiversion v0.2.0 // indirect
kmodules.xyz/monitoring-agent-api v0.32.0 // indirect
kmodules.xyz/offshoot-api v0.32.0 // indirect
kubeops.dev/petset v0.0.9 // indirect
kubeops.dev/sidekick v0.0.10 // indirect
kubeops.dev/petset v0.0.10 // indirect
kubeops.dev/sidekick v0.0.11 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/token v1.1.0 // indirect
sigs.k8s.io/gateway-api v1.1.0 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
Expand Down Expand Up @@ -336,8 +336,8 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg=
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/onsi/ginkgo/v2 v2.23.1 h1:Ox0cOPv/t8RzKJUfDo9ZKtRvBOJY369sFJnl00CjqwY=
github.com/onsi/ginkgo/v2 v2.23.1/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
Expand Down Expand Up @@ -592,8 +592,8 @@ golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down Expand Up @@ -645,8 +645,8 @@ k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU=
k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20250318172550-b98be4ee1595 h1:oj2YLpdiU3TRGr10fBjJ5Gny1rEFB9NC4KZh1lxpn+Y=
k8s.io/kube-openapi v0.0.0-20250318172550-b98be4ee1595/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8=
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4=
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8=
k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0=
k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
Expand All @@ -659,12 +659,12 @@ kmodules.xyz/monitoring-agent-api v0.32.0 h1:cMQbWvbTc4JWeLI/zYE0HLefsdFYBzqvATL
kmodules.xyz/monitoring-agent-api v0.32.0/go.mod h1:zgRKiJcuK7FOHy0Y1TsONRbJfgnPCs8t4Zh/6Afr+yU=
kmodules.xyz/offshoot-api v0.32.0 h1:gogc5scSZe2JoXtZof72UGRl3Tit0kFaFRMkLLT1D8o=
kmodules.xyz/offshoot-api v0.32.0/go.mod h1:tled7OxYZ3SkUJcrVFVVYyd+zXjsRSEm1R6Q3k4gcx0=
kubedb.dev/apimachinery v0.53.0-rc.1 h1:m6fah43nDPBEQhcc5XGs0UjHM5oBLgDwJ9hx8v2wBsU=
kubedb.dev/apimachinery v0.53.0-rc.1/go.mod h1:RqpIP0aPGQKLGegTQcXFnN41QyXyp85plbqA27lLBkw=
kubeops.dev/petset v0.0.9 h1:8+wH2rHtaAUJ+g+fgQ/KcUT4iFIm6LHvKuaq53Fg63A=
kubeops.dev/petset v0.0.9/go.mod h1:RyuWbc1juV1i3/GRnCpemVd3cf6YEFSenhh0to4D2a4=
kubeops.dev/sidekick v0.0.10 h1:/lOT+yV920F6TTPLc7bKR9HLAG/Yx+sTRm1C7rUz744=
kubeops.dev/sidekick v0.0.10/go.mod h1:VRyiiKGiJikv/8dNCkrXfkwZCv/2HoIhkmtNurs0gcM=
kubedb.dev/apimachinery v0.53.0 h1:uxgf/Kc27/A87/oZd+TjddAC2IS5C3ubZGiRBVqu0cc=
kubedb.dev/apimachinery v0.53.0/go.mod h1:CSK+s+3FJcqJv7tx8R1VKDOUMa7bbruOQ9yk7U9dmMo=
kubeops.dev/petset v0.0.10 h1:sNaqmHrD9bW7pcrWnwPoiQrKvdRwRX0BaRQc5QA78Bg=
kubeops.dev/petset v0.0.10/go.mod h1:uHL83kggwmtSxdlIfxNbY2isV22iYV6YjADv0y+Z7YA=
kubeops.dev/sidekick v0.0.11 h1:OydXdIH6cYSiWxKIWvrywk95WhhHSERkc7RNPOmTekc=
kubeops.dev/sidekick v0.0.11/go.mod h1:90KMNmJOPoMKHbrdC1cpEsMx+1KjTea/lHDAbGRDzHc=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI=
lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ type FerretDBVersionSpec struct {
// Database Image
DB FerretDBVersionDatabase `json:"db"`

// Postgres version
Postgres FerretDBVersionPostgres `json:"postgres"`

// Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded.
// +optional
Deprecated bool `json:"deprecated,omitempty"`
Expand All @@ -72,6 +75,11 @@ type FerretDBVersionDatabase struct {
Image string `json:"image"`
}

type FerretDBVersionPostgres struct {
// Which versions pg will be used as backend of ferretdb. default 13.13 when backend internally managed
Version string `json:"version"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// FerretDBVersionList contains a list of FerretDBVersion
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,13 @@ type PostgresSecurityContext struct {
RunAsAnyNonRoot bool `json:"runAsAnyNonRoot,omitempty"`
}

// +kubebuilder:validation:Enum=Official;TimescaleDB;PostGIS;KubeDB;PostgreSQL
// +kubebuilder:validation:Enum=Official;TimescaleDB;PostGIS;KubeDB;DocumentDB;PostgreSQL
type PostgresDistro string

const (
PostgresDistroOfficial PostgresDistro = "Official"
PostgresDistroTimescaleDB PostgresDistro = "TimescaleDB"
PostgresDistroPostGIS PostgresDistro = "PostGIS"
PostgresDistroKubeDB PostgresDistro = "KubeDB"
PostgresDistroDocumentDB PostgresDistro = "DocumentDB"
)

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

3 changes: 3 additions & 0 deletions vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,8 @@ const (
SolrTempConfigDir = "/temp-config"
SolrCustomConfigDir = "/custom-config"
SolrSecurityConfigDir = "/var/security"
SolrZkReadyCondition = "SolrZkReady"
SolrZkReady = "ZookeeperReady"

SolrCloudHostKey = "host"
SolrCloudHostValue = ""
Expand Down Expand Up @@ -1443,6 +1445,7 @@ const (
FerretDBContainerName = "ferretdb"
FerretDBMainImage = "ghcr.io/ferretdb/ferretdb"
FerretDBUser = "postgres"
FerretDBLinkedDBName = "ferretdb"

FerretDBServerPath = "/etc/certs/server"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,6 @@ func (f *FerretDB) SetDefaults(kc client.Client) {
f.setDefaultPodTemplateValues(f.Spec.Server.Secondary.PodTemplate, &frVersion)
}

if f.Spec.Backend.LinkedDB == "" {
if f.Spec.Backend.ExternallyManaged {
f.Spec.Backend.LinkedDB = "postgres"
} else {
f.Spec.Backend.LinkedDB = "ferretdb"
}
}

if f.Spec.AuthSecret == nil {
f.Spec.AuthSecret = &SecretReference{
ExternallyManaged: false,
Expand All @@ -278,19 +270,6 @@ func (f *FerretDB) SetDefaults(kc client.Client) {
f.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = frVersion.Spec.SecurityContext.RunAsUser
}
}
defaultVersion := "16.4-bookworm"
if f.IsLaterVersion(&frVersion, 2) {
defaultVersion = "16.7-doc"
}
if !f.Spec.Backend.ExternallyManaged {
if f.Spec.Backend.Version == nil {
f.Spec.Backend.Version = &defaultVersion
}
}

if f.Spec.Backend.PostgresRef != nil && f.Spec.Backend.PostgresRef.Name != "" && f.Spec.Backend.PostgresRef.Namespace == "" {
f.Spec.Backend.PostgresRef.Namespace = f.Namespace
}

f.SetTLSDefaults()
f.SetHealthCheckerDefaults()
Expand All @@ -314,7 +293,7 @@ func (f *FerretDB) setDefaultPodTemplateValues(podTemplate *ofst.PodTemplateSpec
f.setDefaultPodTemplateSecurityContext(frVersion, podTemplate)
}

func (f *FerretDB) IsLaterVersion(frVersion *catalog.FerretDBVersion, version uint64) bool {
func (f *FerretDB) IsVersionAtLeast(frVersion *catalog.FerretDBVersion, version uint64) bool {
v, _ := semver.NewVersion(frVersion.Spec.Version)
return v.Major() >= version
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ type FerretDBSpec struct {
// Monitor is used monitor database instance and KubeDB Backend
// +optional
Monitor *mona.AgentSpec `json:"monitor,omitempty"`

Backend *FerretDBBackend `json:"backend"`
}

type FerretDBStatus struct {
Expand All @@ -115,19 +113,6 @@ type FerretDBStatus struct {
Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

type FerretDBBackend struct {
// PostgresRef refers to the AppBinding of the backend Postgres server
// +optional
PostgresRef *kmapi.ObjectReference `json:"postgresRef,omitempty"`
// Which versions pg will be used as backend of ferretdb. default 13.13 when backend internally managed
// +optional
Version *string `json:"version,omitempty"`
// A DB inside backend specifically made for ferretdb
// +optional
LinkedDB string `json:"linkedDB,omitempty"`
ExternallyManaged bool `json:"externallyManaged"`
}

type FerretDBServer struct {
Primary *FerretDBServerSpec `json:"primary,omitempty"`
Secondary *FerretDBServerSpec `json:"secondary,omitempty"`
Expand Down

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

Loading
Loading