Skip to content

Commit

Permalink
Refactor kernelSettings default function.
Browse files Browse the repository at this point in the history
Signed-off-by: pritamdas99 <[email protected]>
  • Loading branch information
pritamdas99 committed Nov 27, 2023
1 parent 3d933c9 commit ff70468
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apis/kubedb/v1alpha2/elasticsearch_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,11 @@ func (e *Elasticsearch) SetDefaults(esVersion *catalog.ElasticsearchVersion, top
// if kernelSettings defaults is enabled systls-init container will be injected with the default vm_map_count settings
// if not init container will not be injected and default values will not be set
if e.Spec.KernelSettings == nil {
e.Spec.KernelSettings = &KernelSettings{}
e.Spec.KernelSettings = &KernelSettings{
DisableDefaults: false,
}
}
if e.Spec.KernelSettings != nil && !e.Spec.KernelSettings.DisableDefaults {
if !e.Spec.KernelSettings.DisableDefaults {
e.Spec.KernelSettings.Privileged = true
vmMapCountNotSet := true
if len(e.Spec.KernelSettings.Sysctls) != 0 {
Expand Down

0 comments on commit ff70468

Please sign in to comment.