K8s/Dashboards: Remove slug annotation (#102270)
This commit is contained in:
@@ -35,7 +35,6 @@ const AnnoKeyCreatedBy = "grafana.app/createdBy"
|
||||
const AnnoKeyUpdatedTimestamp = "grafana.app/updatedTimestamp"
|
||||
const AnnoKeyUpdatedBy = "grafana.app/updatedBy"
|
||||
const AnnoKeyFolder = "grafana.app/folder"
|
||||
const AnnoKeySlug = "grafana.app/slug"
|
||||
const AnnoKeyBlob = "grafana.app/blob"
|
||||
const AnnoKeyMessage = "grafana.app/message"
|
||||
|
||||
@@ -88,9 +87,6 @@ type GrafanaMetaAccessor interface {
|
||||
SetMessage(msg string)
|
||||
SetAnnotation(key string, val string)
|
||||
|
||||
GetSlug() string
|
||||
SetSlug(v string)
|
||||
|
||||
SetBlob(v *BlobInfo)
|
||||
GetBlob() *BlobInfo
|
||||
|
||||
@@ -270,14 +266,6 @@ func (m *grafanaMetaAccessor) SetMessage(uid string) {
|
||||
m.SetAnnotation(AnnoKeyMessage, uid)
|
||||
}
|
||||
|
||||
func (m *grafanaMetaAccessor) GetSlug() string {
|
||||
return m.get(AnnoKeySlug)
|
||||
}
|
||||
|
||||
func (m *grafanaMetaAccessor) SetSlug(v string) {
|
||||
m.SetAnnotation(AnnoKeySlug, v)
|
||||
}
|
||||
|
||||
// This will be removed in Grafana 13. Do not add any new usage of it.
|
||||
func (m *grafanaMetaAccessor) GetDeprecatedInternalID() int64 {
|
||||
labels := m.obj.GetLabels()
|
||||
|
||||
@@ -1949,11 +1949,12 @@ func (dr *DashboardServiceImpl) UnstructuredToLegacyDashboard(ctx context.Contex
|
||||
dashVersion := obj.GetGeneration()
|
||||
spec["version"] = dashVersion
|
||||
|
||||
title, _, _ := unstructured.NestedString(spec, "title")
|
||||
out := dashboards.Dashboard{
|
||||
OrgID: orgID,
|
||||
ID: obj.GetDeprecatedInternalID(), // nolint:staticcheck
|
||||
UID: uid,
|
||||
Slug: obj.GetSlug(),
|
||||
Slug: slugify.Slugify(title),
|
||||
FolderUID: obj.GetFolder(),
|
||||
Version: int(dashVersion),
|
||||
Data: simplejson.NewFromAny(spec),
|
||||
|
||||
Reference in New Issue
Block a user