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. 12
      pkg/services/store/kind/dashboard/dashboard.go

@ -211,6 +211,15 @@ func readDashboardIter(iter *jsoniter.Iterator, lookup DatasourceLookup) (*Dashb
}
case "annotations":
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() {
@ -221,6 +230,9 @@ func readDashboardIter(iter *jsoniter.Iterator, lookup DatasourceLookup) (*Dashb
iter.Skip()
}
}
default:
iter.Skip()
}
case "templating":
for sub := iter.ReadObject(); sub != ""; sub = iter.ReadObject() {

Loading…
Cancel
Save