From bbb8072d3ff5a86b42e45179c8dfc1e3f5c0d984 Mon Sep 17 00:00:00 2001 From: fearful-symmetry Date: Thu, 14 Sep 2023 11:49:09 -0700 Subject: [PATCH] add docs, fix typos --- libbeat/esleg/eslegclient/connection.go | 1 + libbeat/idxmgmt/std.go | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libbeat/esleg/eslegclient/connection.go b/libbeat/esleg/eslegclient/connection.go index c027a5765e0c..9736af191fd0 100644 --- a/libbeat/esleg/eslegclient/connection.go +++ b/libbeat/esleg/eslegclient/connection.go @@ -426,6 +426,7 @@ func (conn *Connection) getVersion() error { conn.isServerless = true } else if versionData.Version.BuildFlavor == "default" { conn.isServerless = false + // not sure if this is even possible, just being defensive } else { conn.log.Infof("Got unexpected build flavor '%s'", versionData.Version.BuildFlavor) } diff --git a/libbeat/idxmgmt/std.go b/libbeat/idxmgmt/std.go index 3a0a1de2ded7..f8169dcdf89d 100644 --- a/libbeat/idxmgmt/std.go +++ b/libbeat/idxmgmt/std.go @@ -168,7 +168,7 @@ func (s *indexSupport) BuildSelector(cfg *config.C) (outputs.IndexSelector, erro } err = selCfg.SetChild("indices", -1, sub) if err != nil { - return nil, fmt.Errorf("error setting child 'indicies': %w", err) + return nil, fmt.Errorf("error setting child 'indices': %w", err) } } @@ -270,7 +270,7 @@ func (m *indexManager) Setup(loadTemplate, loadILM LoadMode) error { tmplCfg.Overwrite, tmplCfg.Enabled = templateComponent.overwrite, templateComponent.enabled if ilmComponent.enabled { - tmplCfg, err = applyILMSettings(log, tmplCfg, m.support.ilm.Policy()) + tmplCfg, err = applyILMSettingsToTemplate(log, tmplCfg, m.support.ilm.Policy()) if err != nil { return fmt.Errorf("error applying ILM settings: %w", err) } @@ -341,7 +341,8 @@ func unpackTemplateConfig(info beat.Info, cfg *config.C) (config template.Templa return config, err } -func applyILMSettings( +// applies the specified ILM policy to the provided template, returns a struct of the template config +func applyILMSettingsToTemplate( log *logp.Logger, tmpl template.TemplateConfig, policy ilm.Policy,