Skip to content

Commit

Permalink
update func name
Browse files Browse the repository at this point in the history
  • Loading branch information
nutmos committed Sep 23, 2023
1 parent 40e40b0 commit 5cbf1e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libbeat/template/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (l *ESLoader) Load(config TemplateConfig, info beat.Info, fields []byte, mi
// template if it exists. If you wish to not overwrite an existing template
// then use CheckTemplate prior to calling this method.
func (l *ESLoader) loadTemplate(templateName string, template map[string]interface{}) error {
if sameTemplate, _ := l.isExistingTemplateTheSame(templateName, template); sameTemplate {
if sameTemplate, _ := l.sameAsExistingTemplate(templateName, template); sameTemplate {
l.log.Infof("Not loading template %s to Elasticsearch", templateName)
return nil
}
Expand Down Expand Up @@ -212,7 +212,7 @@ func (l *ESLoader) checkExistsTemplate(name string) (bool, error) {
return true, nil
}

func (l *ESLoader) isExistingTemplateTheSame(name string, newTemplate map[string]interface{}) (bool, error) {
func (l *ESLoader) sameAsExistingTemplate(name string, newTemplate map[string]interface{}) (bool, error) {
path := "/_index_template/" + name
status, body, err := l.client.Request("GET", path, "", nil, nil)
if err != nil {
Expand Down

0 comments on commit 5cbf1e9

Please sign in to comment.