K8s: Indexing: Fix v2 (#100683)

pull/85403/merge
Stephanie Hingtgen 4 months ago committed by GitHub
parent c1b48cc488
commit 503bc2ba66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 26
      pkg/services/store/kind/dashboard/dashboard.go

@ -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)
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()
}
} else {
iter.Skip()
}
default:
iter.Skip()
}
case "templating":

Loading…
Cancel
Save