K8s: Dashboards: Add search to dashboard service (#98395)
This commit is contained in:
@@ -34,8 +34,9 @@ const AnnoKeyRepoPath = "grafana.app/repoPath"
|
||||
const AnnoKeyRepoHash = "grafana.app/repoHash"
|
||||
const AnnoKeyRepoTimestamp = "grafana.app/repoTimestamp"
|
||||
|
||||
// LabelKeyDeprecatedInternalID gives the deprecated internal ID of a resource
|
||||
// Deprecated: will be removed in grafana 13
|
||||
const labelKeyDeprecatedInternalID = "grafana.app/deprecatedInternalID"
|
||||
const LabelKeyDeprecatedInternalID = "grafana.app/deprecatedInternalID"
|
||||
|
||||
// These can be removed once we verify that non of the dual-write sources
|
||||
// (for dashboards/playlists/etc) depend on the saved internal ID in SQL
|
||||
@@ -299,7 +300,7 @@ func (m *grafanaMetaAccessor) GetDeprecatedInternalID() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
if internalID, ok := labels[labelKeyDeprecatedInternalID]; ok {
|
||||
if internalID, ok := labels[LabelKeyDeprecatedInternalID]; ok {
|
||||
id, err := strconv.ParseInt(internalID, 10, 64)
|
||||
if err == nil {
|
||||
return id
|
||||
@@ -316,7 +317,7 @@ func (m *grafanaMetaAccessor) SetDeprecatedInternalID(id int64) {
|
||||
// disallow setting it to 0
|
||||
if id == 0 {
|
||||
if labels != nil {
|
||||
delete(labels, labelKeyDeprecatedInternalID)
|
||||
delete(labels, LabelKeyDeprecatedInternalID)
|
||||
m.obj.SetLabels(labels)
|
||||
}
|
||||
return
|
||||
@@ -326,7 +327,7 @@ func (m *grafanaMetaAccessor) SetDeprecatedInternalID(id int64) {
|
||||
labels = make(map[string]string)
|
||||
}
|
||||
|
||||
labels[labelKeyDeprecatedInternalID] = strconv.FormatInt(id, 10)
|
||||
labels[LabelKeyDeprecatedInternalID] = strconv.FormatInt(id, 10)
|
||||
m.obj.SetLabels(labels)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user