Skip to content

Commit

Permalink
Ensure index pattern version is a string (#10689) (#10711)
Browse files Browse the repository at this point in the history
  • Loading branch information
simitt authored and graphaelli committed Mar 5, 2019
1 parent c5bdcdb commit 70d813d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libbeat/kibana/index_pattern_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (i *IndexPatternGenerator) generatePattern(attrs common.MapStr) common.MapS
common.MapStr{
"type": "index-pattern",
"id": i.indexName,
"version": 1,
"version": "1",
"attributes": attrs,
},
},
Expand Down
2 changes: 1 addition & 1 deletion libbeat/kibana/index_pattern_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func testGenerate(t *testing.T, tests []compare, sourceFilters bool) {
objExisting := existing["objects"].([]interface{})[0].(map[string]interface{})
objCreated := test.created["objects"].([]common.MapStr)[0]

assert.Equal(t, int(objExisting["version"].(float64)), objCreated["version"])
assert.Equal(t, objExisting["version"], objCreated["version"])
assert.Equal(t, objExisting["id"], objCreated["id"])
assert.Equal(t, objExisting["type"], objCreated["type"])

Expand Down
2 changes: 1 addition & 1 deletion libbeat/kibana/testdata/beat-6.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"id": "beat-*",
"type": "index-pattern",
"version": 1
"version": "1"
}
],
"version": "7.0.0-alpha1"
Expand Down
2 changes: 1 addition & 1 deletion libbeat/kibana/testdata/extensive/metricbeat-6.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"timeFieldName": "@timestamp",
"title": "metricbeat-*"
},
"version": 1,
"version": "1",
"type": "index-pattern",
"id": "metricbeat-*"
}
Expand Down

0 comments on commit 70d813d

Please sign in to comment.