From 727c72e26c24d057315e043bbf9fac547623727d Mon Sep 17 00:00:00 2001 From: pritamdas99 Date: Thu, 23 Nov 2023 16:31:08 +0600 Subject: [PATCH] Applied make gen fmt. Signed-off-by: pritamdas99 --- .../elasticsearchdashboard_webhook.go | 8 +++-- apis/kubedb/v1alpha2/elasticsearch_helpers.go | 33 ------------------- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/apis/dashboard/v1alpha1/elasticsearchdashboard_webhook.go b/apis/dashboard/v1alpha1/elasticsearchdashboard_webhook.go index e3124b540a..27f0cd1df8 100644 --- a/apis/dashboard/v1alpha1/elasticsearchdashboard_webhook.go +++ b/apis/dashboard/v1alpha1/elasticsearchdashboard_webhook.go @@ -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" @@ -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" diff --git a/apis/kubedb/v1alpha2/elasticsearch_helpers.go b/apis/kubedb/v1alpha2/elasticsearch_helpers.go index 1b28474ace..d2a3bcdf7f 100644 --- a/apis/kubedb/v1alpha2/elasticsearch_helpers.go +++ b/apis/kubedb/v1alpha2/elasticsearch_helpers.go @@ -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) } @@ -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)