Skip to content

Commit

Permalink
Prepare for release v0.7.0-rc.0 (#161)
Browse files Browse the repository at this point in the history
ProductLine: KubeDB

Release: v2025.2.6-rc.0

Release-tracker: kubedb/CHANGELOG#106

Signed-off-by: 1gtm <1gtm@appscode.com>
  • Loading branch information
1gtm authored Feb 6, 2025
1 parent 4790577 commit 7deb14c
Show file tree
Hide file tree
Showing 39 changed files with 4,376 additions and 298 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
k8s.io/klog/v2 v2.130.1
kmodules.xyz/client-go v0.30.44
kmodules.xyz/custom-resources v0.30.0
kubedb.dev/apimachinery v0.51.1-0.20250127085441-7f9ee3e6b9a6
kubedb.dev/apimachinery v0.52.0-rc.0
sigs.k8s.io/controller-runtime v0.18.4
xorm.io/xorm v1.3.6
)
Expand Down Expand Up @@ -128,7 +128,7 @@ require (
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/time v0.6.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
gomodules.xyz/mergo v0.3.13 // indirect
gomodules.xyz/pointer v0.1.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
Expand Down Expand Up @@ -663,8 +663,8 @@ kmodules.xyz/monitoring-agent-api v0.30.2 h1:sAgz5P5EXZqhlj1NzJ+QltAgeIx5bGSMj+a
kmodules.xyz/monitoring-agent-api v0.30.2/go.mod h1:BoZFPDDRB7J39CcUsSDlzgW8PQCwik4ILPleyUob+Mg=
kmodules.xyz/offshoot-api v0.30.1 h1:TrulAYO+oBsXe9sZZGTmNWIuI8qD2izMpgcTSPvgAmI=
kmodules.xyz/offshoot-api v0.30.1/go.mod h1:T3mpjR6fui0QzOcmQvIuANytW48fe9ytmy/1cgx6D4g=
kubedb.dev/apimachinery v0.51.1-0.20250127085441-7f9ee3e6b9a6 h1:E03N1SRs3wWppLqHHrfMB1hzNdsgTBI5UwCzMxfWOHI=
kubedb.dev/apimachinery v0.51.1-0.20250127085441-7f9ee3e6b9a6/go.mod h1:pbuXlEZM70Uw1SnSGH7bbzcAiwEYq4NX0CRG8ugODNY=
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=
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=
Expand Down
4 changes: 2 additions & 2 deletions vendor/golang.org/x/time/LICENSE

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 @@ -54,6 +54,9 @@ type MariaDBVersionSpec struct {
Version string `json:"version"`
// Database Image
DB MariaDBVersionDatabase `json:"db"`
// Maxscale Image
// +optional
Maxscale MariaDBVersionMaxscale `json:"maxscale"`
// Exporter Image
Exporter MariaDBVersionExporter `json:"exporter"`
// Coordinator Image
Expand Down Expand Up @@ -87,6 +90,14 @@ type MariaDBVersionDatabase struct {
Image string `json:"image"`
}

// MariaDBVersionMaxscale is the mariadb maxscale image
type MariaDBVersionMaxscale struct {
Image string `json:"image"`
// SecurityContext is for the additional config for the maxscale container
// +optional
SecurityContext SecurityContext `json:"securityContext"`
}

// MariaDBVersionExporter is the image for the MariaDB exporter
type MariaDBVersionExporter struct {
Image string `json:"image"`
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 @@ -74,6 +74,9 @@ type PostgresVersionSpec struct {
// SecurityContext is for the additional config for postgres DB container
// +optional
SecurityContext PostgresSecurityContext `json:"securityContext"`
// PostgresVersionTLSSpec is used to set postgres version specific tls settings
// +optional
TLS *PostgresVersionTLSSpec `json:"tls,omitempty"`
// update constraints
UpdateConstraints UpdateConstraints `json:"updateConstraints,omitempty"`
// +optional
Expand Down Expand Up @@ -110,6 +113,13 @@ type PostgresVersionPodSecurityPolicy struct {
DatabasePolicyName string `json:"databasePolicyName"`
}

// PostgresVersionTLSSpec is used to set postgres version specific tls settings
type PostgresVersionTLSSpec struct {
// DisableSSLSessionResumption determines whether to disable or enable Envoy Session Resumption
// +optional
DisableSSLSessionResumption bool `json:"disableSSLSessionResumption,omitempty"`
}

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

// PostgresVersionList is a list of PostgresVersions
Expand Down

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

31 changes: 19 additions & 12 deletions vendor/kubedb.dev/apimachinery/apis/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func SetDefaultResourceLimits(req *core.ResourceRequirements, defaultResources c
// - return limit
// else
// - return default

calLimit := func(name core.ResourceName, defaultValue resource.Quantity) resource.Quantity {
if r, ok := req.Requests[name]; ok {
// l is greater than r == 1.
if l, exist := req.Limits[name]; exist && l.Cmp(r) == 1 {
if l, exist := req.Limits[name]; exist && l.Cmp(r) > 0 {
return l
}
return r
Expand All @@ -56,6 +56,7 @@ func SetDefaultResourceLimits(req *core.ResourceRequirements, defaultResources c
}
return defaultValue
}

// if request is not set,
// - if limit exists:
// - copy limit
Expand All @@ -64,15 +65,15 @@ func SetDefaultResourceLimits(req *core.ResourceRequirements, defaultResources c
// else
// - return request
// endif
calRequest := func(name core.ResourceName, defaultValue resource.Quantity) resource.Quantity {
if r, ok := req.Requests[name]; !ok {
if l, exist := req.Limits[name]; exist {
return l
}
return defaultValue
} else {
calRequest := func(name core.ResourceName, defaultValue resource.Quantity, originalLimit resource.Quantity) resource.Quantity {
if r, ok := req.Requests[name]; ok {
return r
}
if originalLimit.Value() > 0 {
// If original Limits existed, use them for Requests
return originalLimit
}
return defaultValue
}

if req.Limits == nil {
Expand All @@ -82,13 +83,19 @@ func SetDefaultResourceLimits(req *core.ResourceRequirements, defaultResources c
req.Requests = core.ResourceList{}
}

// Calculate the limits first
// Store the original Limits to differentiate between newly set and existing values
originalLimits := make(map[core.ResourceName]resource.Quantity)
for l := range req.Limits {
originalLimits[l] = req.Limits[l]
}

// Calculate limits first
for l := range defaultResources.Limits {
req.Limits[l] = calLimit(l, defaultResources.Limits[l])
}

// Once the limit is calculated, Calculate requests
// Calculate requests after limits
for r := range defaultResources.Requests {
req.Requests[r] = calRequest(r, defaultResources.Requests[r])
req.Requests[r] = calRequest(r, defaultResources.Requests[r], originalLimits[r])
}
}
Loading

0 comments on commit 7deb14c

Please sign in to comment.