Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
Signed-off-by: Rudro-25 <[email protected]>
  • Loading branch information
Rudro-25 committed Sep 16, 2024
1 parent b8c278d commit eb65a5b
Show file tree
Hide file tree
Showing 13 changed files with 253 additions and 52 deletions.
2 changes: 1 addition & 1 deletion 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.13
kmodules.xyz/custom-resources v0.30.0
kubedb.dev/apimachinery v0.47.0
kubedb.dev/apimachinery v0.47.1-0.20240916092623-3d0074037714
sigs.k8s.io/controller-runtime v0.18.4
xorm.io/xorm v1.3.6
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,8 @@ kmodules.xyz/monitoring-agent-api v0.29.0 h1:gpFl6OZrlMLb/ySMHdREI9EwGtnJ91oZBn9
kmodules.xyz/monitoring-agent-api v0.29.0/go.mod h1:iNbvaMTgVFOI5q2LJtGK91j4Dmjv4ZRiRdasGmWLKQI=
kmodules.xyz/offshoot-api v0.30.0 h1:dq9F93pu4Q8rL9oTcCk+vGGy8vpS7RNt0GSwx7Bvhec=
kmodules.xyz/offshoot-api v0.30.0/go.mod h1:o9VoA3ImZMDBp3lpLb8+kc2d/KBxioRwCpaKDfLIyDw=
kubedb.dev/apimachinery v0.47.0 h1:QhcjY2wJb/5L0YmfJAUiPw0VU1mMJqvILL2t8znniJo=
kubedb.dev/apimachinery v0.47.0/go.mod h1:W/uKm13rLuaz+uqZUt6piU/qA0EdLKHuN53V2DYheJI=
kubedb.dev/apimachinery v0.47.1-0.20240916092623-3d0074037714 h1:/c3fln5L2ZekYz7Go8tG5616jg6yVzGy3Y328E1G4xo=
kubedb.dev/apimachinery v0.47.1-0.20240916092623-3d0074037714/go.mod h1:dsSAmHt0j14fmKhtFZC4RlX4Aiytz/RVq3S0b30Mkug=
kubeops.dev/petset v0.0.6 h1:0IbvxD9fadZfH+3iMZWzN6ZHsO0vX458JlioamwyPKQ=
kubeops.dev/petset v0.0.6/go.mod h1:A15vh0r979NsvL65DTIZKWsa/NoX9VapHBAEw1ZsdYI=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ type MemcachedVersionSpec struct {
Deprecated bool `json:"deprecated,omitempty"`
// PSP names
PodSecurityPolicies MemcachedVersionPodSecurityPolicy `json:"podSecurityPolicies"`
// update constraints
UpdateConstraints UpdateConstraints `json:"updateConstraints,omitempty"`
// SecurityContext is for the additional config for the DB container
// +optional
SecurityContext SecurityContext `json:"securityContext"`
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 @@ -63,3 +63,7 @@ spec.exporter.image.`, p.Name)
}
return nil
}

func (p PgBouncerVersion) IsDeprecated() bool {
return p.Spec.Deprecated
}

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 @@ -377,6 +377,16 @@ func (m *MSSQLServer) SetDefaults() {
m.SetHealthCheckerDefaults()

m.setDefaultContainerResourceLimits(m.Spec.PodTemplate)

m.Spec.Monitor.SetDefaults()
if m.Spec.Monitor != nil && m.Spec.Monitor.Prometheus != nil {
if m.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser == nil {
m.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser = mssqlVersion.Spec.SecurityContext.RunAsUser
}
if m.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup == nil {
m.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsGroup = mssqlVersion.Spec.SecurityContext.RunAsUser
}
}
}

func (m *MSSQLServer) setDefaultContainerSecurityContext(mssqlVersion *catalog.MSSQLServerVersion, podTemplate *ofst.PodTemplateSpec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,51 +129,32 @@ func (p *Pgpool) ValidateCreateOrUpdate() field.ErrorList {
"use either `spec.configSecret` or `spec.initConfig`"))
}

if p.Spec.ConfigSecret != nil {
secret := core.Secret{}
if p.ObjectMeta.DeletionTimestamp == nil {
apb := appcat.AppBinding{}
err := DefaultClient.Get(context.TODO(), types.NamespacedName{
Name: p.Spec.ConfigSecret.Name,
Namespace: p.Namespace,
}, &secret)
Name: p.Spec.PostgresRef.Name,
Namespace: p.Spec.PostgresRef.Namespace,
}, &apb)
if err != nil {
errorList = append(errorList, field.Invalid(field.NewPath("spec").Child("configSecret"),
errorList = append(errorList, field.Invalid(field.NewPath("spec").Child("postgresRef"),
p.Name,
err.Error(),
))
}
_, ok := secret.Data[kubedb.PgpoolCustomConfigFile]
if !ok {
errorList = append(errorList, field.Invalid(field.NewPath("spec").Child("configSecret"),

backendSSL, err := p.IsBackendTLSEnabled()
if err != nil {
errorList = append(errorList, field.Invalid(field.NewPath("spec").Child("postgresRef"),
p.Name,
fmt.Sprintf("`%v` is missing", kubedb.PgpoolCustomConfigFile),
err.Error(),
))
}
}

apb := appcat.AppBinding{}
err := DefaultClient.Get(context.TODO(), types.NamespacedName{
Name: p.Spec.PostgresRef.Name,
Namespace: p.Spec.PostgresRef.Namespace,
}, &apb)
if err != nil {
errorList = append(errorList, field.Invalid(field.NewPath("spec").Child("postgresRef"),
p.Name,
err.Error(),
))
}

backendSSL, err := p.IsBackendTLSEnabled()
if err != nil {
errorList = append(errorList, field.Invalid(field.NewPath("spec").Child("postgresRef"),
p.Name,
err.Error(),
))
}

if p.Spec.TLS == nil && backendSSL {
errorList = append(errorList, field.Required(field.NewPath("spec").Child("tls"),
"`spec.tls` must be set because backend postgres is tls enabled",
))
if p.Spec.TLS == nil && backendSSL {
errorList = append(errorList, field.Required(field.NewPath("spec").Child("tls"),
"`spec.tls` must be set because backend postgres is tls enabled",
))
}
}

if p.Spec.TLS == nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ spec:
- name
type: object
type: array
updateConstraints:
properties:
allowlist:
items:
type: string
type: array
denylist:
items:
type: string
type: array
type: object
version:
type: string
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ spec:
type: object
spec:
properties:
UpdateVersion:
properties:
readinessCriteria:
type: object
targetVersion:
type: string
type: object
apply:
default: IfReady
enum:
Expand Down Expand Up @@ -183,7 +176,13 @@ spec:
enum:
- HorizontalScaling
- VerticalScaling
- UpdateVersion
type: string
updateVersion:
properties:
targetVersion:
type: string
type: object
verticalScaling:
properties:
exporter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,118 @@ spec:
- IfReady
- Always
type: string
configuration:
properties:
applyConfig:
additionalProperties:
type: string
type: object
configSecret:
properties:
name:
default: ""
type: string
type: object
x-kubernetes-map-type: atomic
removeCustomConfig:
type: boolean
type: object
databaseRef:
properties:
name:
default: ""
type: string
type: object
x-kubernetes-map-type: atomic
horizontalScaling:
properties:
replicas:
format: int32
type: integer
type: object
restart:
type: object
timeout:
type: string
type:
enum:
- UpdateVersion
- HorizontalScaling
- VerticalScaling
- VolumeExpansion
- Restart
- Reconfigure
type: string
updateVersion:
properties:
targetVersion:
type: string
type: object
verticalScaling:
properties:
node:
properties:
nodeSelectionPolicy:
type: string
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
topology:
properties:
key:
type: string
value:
type: string
required:
- key
- value
type: object
type: object
type: object
volumeExpansion:
properties:
mode:
enum:
- Offline
- Online
type: string
node:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- mode
type: object
required:
- databaseRef
- type
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ kmodules.xyz/offshoot-api/api/v1
kmodules.xyz/offshoot-api/api/v1/conversion
kmodules.xyz/offshoot-api/api/v2
kmodules.xyz/offshoot-api/util
# kubedb.dev/apimachinery v0.47.0
# kubedb.dev/apimachinery v0.47.1-0.20240916092623-3d0074037714
## explicit; go 1.22.1
kubedb.dev/apimachinery/apis
kubedb.dev/apimachinery/apis/catalog
Expand Down
Loading

0 comments on commit eb65a5b

Please sign in to comment.