Skip to content

Commit

Permalink
Set default user for exporter container
Browse files Browse the repository at this point in the history
Signed-off-by: raihankhan <[email protected]>
  • Loading branch information
raihankhan committed Nov 24, 2023
1 parent f6900a9 commit 49ab53b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apis/kubedb/v1alpha2/elasticsearch_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,17 @@ func (e *Elasticsearch) SetDefaults(esVersion *catalog.ElasticsearchVersion, top
e.setDefaultAffinity(&e.Spec.PodTemplate, e.OffshootSelectors(), topology)
e.setContainerSecurityContextDefaults(&e.Spec.PodTemplate)
e.setDefaultInternalUsersAndRoleMappings(esVersion)
e.SetMetricsExporterDefaults()
e.SetTLSDefaults(esVersion)
}

func (e *Elasticsearch) SetMetricsExporterDefaults() {
e.Spec.Monitor.SetDefaults()
if e.Spec.Monitor != nil && e.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsNonRoot == pointer.BoolP(true) {
if e.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser == nil {
e.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser = pointer.Int64P(1000)
}
}
}

// setDefaultAffinity
Expand Down

0 comments on commit 49ab53b

Please sign in to comment.