Skip to content

Commit

Permalink
Applied make gen fmt.
Browse files Browse the repository at this point in the history
Signed-off-by: pritamdas99 <[email protected]>
  • Loading branch information
pritamdas99 committed Nov 23, 2023
1 parent 3ffa8dc commit 727c72e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 36 deletions.
8 changes: 5 additions & 3 deletions apis/dashboard/v1alpha1/elasticsearchdashboard_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ package v1alpha1

import (
"fmt"

"kubedb.dev/apimachinery/apis"
api "kubedb.dev/apimachinery/apis/kubedb/v1alpha2"
amv "kubedb.dev/apimachinery/pkg/validator"

"github.com/pkg/errors"
"gomodules.xyz/pointer"
core "k8s.io/api/core/v1"
Expand All @@ -26,9 +31,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/validation/field"
kmapi "kmodules.xyz/client-go/api/v1"
"kubedb.dev/apimachinery/apis"
api "kubedb.dev/apimachinery/apis/kubedb/v1alpha2"
amv "kubedb.dev/apimachinery/pkg/validator"
"sigs.k8s.io/controller-runtime/pkg/builder"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
Expand Down
33 changes: 0 additions & 33 deletions apis/kubedb/v1alpha2/elasticsearch_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,6 @@ func (e Elasticsearch) StatsServiceLabels() map[string]string {
}

func setDefaultContainerSecurityContext(containerSecurityContext *core.SecurityContext) {
//containerSecurityContext := &core.SecurityContext{}
//if e.Spec.PodTemplate.Spec.ContainerSecurityContext != nil {
// containerSecurityContext = e.Spec.PodTemplate.Spec.ContainerSecurityContext
//}
if containerSecurityContext.AllowPrivilegeEscalation == nil {
containerSecurityContext.AllowPrivilegeEscalation = pointer.BoolP(false)
}
Expand Down Expand Up @@ -620,35 +616,6 @@ func (e *Elasticsearch) SetDefaults(esVersion *catalog.ElasticsearchVersion, top
}
}

// set default kernel settings
// - Ref: https://www.elastic.co/guide/en/elasticsearch/reference/7.9/vm-max-map-count.html
//if e.Spec.KernelSettings == nil {
// e.Spec.KernelSettings = &KernelSettings{
// Privileged: true,
// Sysctls: []core.Sysctl{
// {
// Name: "vm.max_map_count",
// Value: "262144",
// },
// },
// }
//}
//
//if e.Spec.PodTemplate.Spec.ContainerSecurityContext == nil {
// e.Spec.PodTemplate.Spec.ContainerSecurityContext = &core.SecurityContext{
// Privileged: pointer.BoolP(false),
// Capabilities: &core.Capabilities{
// Add: []core.Capability{"IPC_LOCK", "SYS_RESOURCE"},
// },
// }
//}
//
//// Add default Elasticsearch UID
//if e.Spec.PodTemplate.Spec.ContainerSecurityContext.RunAsUser == nil &&
// esVersion.Spec.SecurityContext.RunAsUser != nil {
// e.Spec.PodTemplate.Spec.ContainerSecurityContext.RunAsUser = esVersion.Spec.SecurityContext.RunAsUser
//}

e.setDefaultContainerSecurityContextForPodTemplate()
e.setDefaultContainerSecurityContextForMonitor()
e.setDefaultAffinity(&e.Spec.PodTemplate, e.OffshootSelectors(), topology)
Expand Down

0 comments on commit 727c72e

Please sign in to comment.