K8s/Unified: Consolidate generation logic in apistore client (#102260)

This commit is contained in:
Ryan McKinley
2025-03-21 10:45:25 +02:00
committed by GitHub
parent 996ff7d65e
commit 2e2b5942c8
9 changed files with 237 additions and 56 deletions
+9
View File
@@ -86,6 +86,7 @@ type GrafanaMetaAccessor interface {
GetMessage() string
SetMessage(msg string)
SetAnnotation(key string, val string)
GetAnnotation(key string) string
SetBlob(v *BlobInfo)
GetBlob() *BlobInfo
@@ -192,6 +193,14 @@ func (m *grafanaMetaAccessor) SetAnnotation(key string, val string) {
m.obj.SetAnnotations(anno)
}
func (m *grafanaMetaAccessor) GetAnnotation(key string) string {
anno := m.obj.GetAnnotations()
if anno != nil {
return anno[key]
}
return ""
}
func (m *grafanaMetaAccessor) get(key string) string {
return m.obj.GetAnnotations()[key]
}