Skip to content

Commit

Permalink
Fix elasticsearch mapping comparison for healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
gotha committed Jul 6, 2020
1 parent 54a73cd commit 785fb02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/es/service.go
Expand Up @@ -57,12 +57,13 @@ func (s *ElasticsearchService) GetSchemaHealth() (string, error) {
return "", err
}

fullReferenceJSON := []byte(fmt.Sprintf(`{"ft": %s}`, string(referenceJSON)))
fullReferenceJSON := []byte(fmt.Sprintf(`{"%s": %s}`, s.IndexName, string(referenceJSON)))
err = json.Unmarshal(fullReferenceJSON, &referenceIndex.index)
if err != nil {
return "", err
}
}

if referenceIndex.index[s.IndexName] == nil || referenceIndex.index[s.IndexName].Settings == nil || referenceIndex.index[s.IndexName].Mappings == nil {
return "not ok, wrong referenceIndex", nil
}
Expand Down

0 comments on commit 785fb02

Please sign in to comment.