mirror of https://github.com/grafana/grafana.git
K8s: Indexing: Fix v2 (#100683)
This commit is contained in:
parent
c1b48cc488
commit
503bc2ba66
|
|
@ -211,15 +211,27 @@ func readDashboardIter(iter *jsoniter.Iterator, lookup DatasourceLookup) (*Dashb
|
|||
}
|
||||
|
||||
case "annotations":
|
||||
for sub := iter.ReadObject(); sub != ""; sub = iter.ReadObject() {
|
||||
if sub == "list" {
|
||||
for iter.ReadArray() {
|
||||
v := iter.Read()
|
||||
logf("[dash.anno] %v\n", v)
|
||||
}
|
||||
} else {
|
||||
iter.Skip()
|
||||
switch iter.WhatIsNext() {
|
||||
case jsoniter.ArrayValue:
|
||||
// dashboards v2 is an array
|
||||
for iter.ReadArray() {
|
||||
v := iter.Read()
|
||||
logf("[dash.anno] %v\n", v)
|
||||
}
|
||||
case jsoniter.ObjectValue:
|
||||
// dashboards v0/v1 are an object
|
||||
for sub := iter.ReadObject(); sub != ""; sub = iter.ReadObject() {
|
||||
if sub == "list" {
|
||||
for iter.ReadArray() {
|
||||
v := iter.Read()
|
||||
logf("[dash.anno] %v\n", v)
|
||||
}
|
||||
} else {
|
||||
iter.Skip()
|
||||
}
|
||||
}
|
||||
default:
|
||||
iter.Skip()
|
||||
}
|
||||
|
||||
case "templating":
|
||||
|
|
|
|||
Loading…
Reference in New Issue