K8s/Unified: Consolidate generation logic in apistore client (#102260)
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user