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
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ require (
kmodules.xyz/client-go v0.32.1
kmodules.xyz/custom-resources v0.32.0
kmodules.xyz/monitoring-agent-api v0.32.0
kubedb.dev/apimachinery v0.53.0-rc.1
kubedb.dev/db-client-go v0.8.0-rc.1
kubeops.dev/petset v0.0.9
kubedb.dev/apimachinery v0.53.0
kubedb.dev/db-client-go v0.8.0
kubeops.dev/petset v0.0.10
sigs.k8s.io/controller-runtime v0.20.3
sigs.k8s.io/yaml v1.4.0
stash.appscode.dev/apimachinery v0.39.0
Expand Down Expand Up @@ -138,7 +138,7 @@ require (
k8s.io/apiextensions-apiserver v0.32.3 // indirect
k8s.io/apiserver v0.32.3 // indirect
k8s.io/kube-aggregator 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/metrics v0.32.3 // indirect
k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect
kmodules.xyz/apiversion v0.2.0 // indirect
Expand All @@ -147,8 +147,8 @@ require (
kmodules.xyz/prober v0.32.0 // indirect
kmodules.xyz/resource-metadata v0.26.1 // indirect
kubeops.dev/csi-driver-cacerts v0.1.0 // indirect
kubeops.dev/sidekick v0.0.10 // indirect
kubestash.dev/apimachinery v0.17.0-rc.0 // indirect
kubeops.dev/sidekick v0.0.11 // indirect
kubestash.dev/apimachinery v0.17.0 // indirect
sigs.k8s.io/gateway-api v1.1.0 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/kustomize/api v0.18.0 // indirect
Expand Down
32 changes: 16 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JX
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
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.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM=
github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM=
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.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
Expand Down Expand Up @@ -573,8 +573,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY
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.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
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-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down Expand Up @@ -676,8 +676,8 @@ k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-aggregator v0.32.3 h1:j+lUE4V1sMANYv/wCdU2E8SgnSLJksaJ+6bNnoV6Pfs=
k8s.io/kube-aggregator v0.32.3/go.mod h1:aAl5az9Rlq4sPPSf8/ckpDGSYit75g4g1dp6rKInXZM=
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/kubectl v0.29.0 h1:Oqi48gXjikDhrBF67AYuZRTcJV4lg2l42GmvsP7FmYI=
k8s.io/kubectl v0.29.0/go.mod h1:0jMjGWIcMIQzmUaMgAzhSELv5WtHo2a8pq67DtviAJs=
k8s.io/metrics v0.32.3 h1:2vsBvw0v8rIIlczZ/lZ8Kcqk9tR6Fks9h+dtFNbc2a4=
Expand All @@ -702,18 +702,18 @@ kmodules.xyz/prober v0.32.0 h1:8Z6pFRAu8kP0wwX2BooPCRy2SE6ZkUMHQmZDH5VUEGY=
kmodules.xyz/prober v0.32.0/go.mod h1:h0fH4m9DaIwuNZq85zOlWUvBycyy4LvCPMUUhpS3iSE=
kmodules.xyz/resource-metadata v0.26.1 h1:FKxvM8v5GkWWAnLHwnHGZNgewzNtKO7SDP+mRTA6M4g=
kmodules.xyz/resource-metadata v0.26.1/go.mod h1:E4scoxcEgd7NGLU69IiS0Qh+KnwYQ/ckZtDyA8ydZKs=
kubedb.dev/apimachinery v0.53.0-rc.1 h1:m6fah43nDPBEQhcc5XGs0UjHM5oBLgDwJ9hx8v2wBsU=
kubedb.dev/apimachinery v0.53.0-rc.1/go.mod h1:RqpIP0aPGQKLGegTQcXFnN41QyXyp85plbqA27lLBkw=
kubedb.dev/db-client-go v0.8.0-rc.1 h1:SgiiZqHLguS/TzNp3WcS//20hSVtdCZm12e6AY8uL1Q=
kubedb.dev/db-client-go v0.8.0-rc.1/go.mod h1:xlBK8fwZ0/rDTT8GbH9iWesLapFEZtH5pbeSZyBrfSo=
kubedb.dev/apimachinery v0.53.0 h1:uxgf/Kc27/A87/oZd+TjddAC2IS5C3ubZGiRBVqu0cc=
kubedb.dev/apimachinery v0.53.0/go.mod h1:CSK+s+3FJcqJv7tx8R1VKDOUMa7bbruOQ9yk7U9dmMo=
kubedb.dev/db-client-go v0.8.0 h1:/GuEqnxEH7hd6OEsNw6iL+c5lia9qMmjrMdqcmFLM2c=
kubedb.dev/db-client-go v0.8.0/go.mod h1:AdVl0R1pxvHRAjuAICh9MpAbQTVLIs6v0FrzJhl1iR0=
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.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=
kubestash.dev/apimachinery v0.17.0-rc.0 h1:W45jbhVIc8/LTE1Zh8ixtr7Ayan1tePmoyAsouU6eTk=
kubestash.dev/apimachinery v0.17.0-rc.0/go.mod h1:oggAzrdIEm+S0A0c3mLpcIXtn0x08jzlOgVn4sUFJco=
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=
kubestash.dev/apimachinery v0.17.0 h1:ON7yCYUYVpM6o4M4GcYENJ1GVCWzi9BWblPx2VVw7bw=
kubestash.dev/apimachinery v0.17.0/go.mod h1:DJA9+lXsdUaXNryb6P+XIaEtUHR18gMA5wqly0Y4/fE=
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=
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
Loading
Loading