Skip to content

Commit

Permalink
Load index pattern before dashboards during setup (#14237)
Browse files Browse the repository at this point in the history
During setup, if dashboards import fails (or maybe dashboards folder is
not present, like in development mode) we will not push the
index pattern.

This change makes sure we deploy the index pattern first, then proceed
with dashboards.
  • Loading branch information
Carlos Pérez-Aradros Herce authored Oct 28, 2019
1 parent 65b7589 commit 5cf0b84
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libbeat/dashboards/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,18 +298,18 @@ func (imp Importer) ImportKibanaDir(dir string) error {

versionPath := "7"

// Loads the internal index pattern
if imp.fields != nil {
imp.loader.ImportIndex(imp.fields)
}

dir = path.Join(dir, versionPath)

imp.loader.statusMsg("Importing directory %v", dir)

if _, err := os.Stat(dir); err != nil {
return newErrNotFound("No directory %s", dir)
}

// Loads the internal index pattern
if imp.fields != nil {
imp.loader.ImportIndex(imp.fields)
}
check := []string{}
if !imp.cfg.OnlyDashboards {
check = append(check, "index-pattern")
Expand Down

0 comments on commit 5cf0b84

Please sign in to comment.