Skip to content

Commit

Permalink
Defaulting DB namespace to init archiver fields
Browse files Browse the repository at this point in the history
Signed-off-by: sayedppqq <sayed@appscode.com>
  • Loading branch information
sayedppqq committed Feb 14, 2025
1 parent 39cd66e commit 2b2391b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apis/kubedb/v1/mongodb_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2b2391b

Please sign in to comment.