mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8s: Remove action metadata key (#88591)
* remove action * remove action * remove action * fix test
This commit is contained in:
parent
d83818f8cc
commit
71be5c6eb4
@ -68,7 +68,6 @@ func entityToResource(rsp *entityStore.Entity, res runtime.Object, codec runtime
|
||||
grafanaAccessor.SetUpdatedTimestamp(&updatedAt)
|
||||
}
|
||||
grafanaAccessor.SetSlug(rsp.Slug)
|
||||
grafanaAccessor.SetAction(rsp.Action.String())
|
||||
|
||||
if rsp.Origin != nil {
|
||||
originTime := time.UnixMilli(rsp.Origin.Time).UTC()
|
||||
|
@ -5,14 +5,15 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/apis/playlist/v0alpha1"
|
||||
entityStore "github.com/grafana/grafana/pkg/services/store/entity"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
"k8s.io/apiserver/pkg/endpoints/request"
|
||||
|
||||
"github.com/grafana/grafana/pkg/apis/playlist/v0alpha1"
|
||||
entityStore "github.com/grafana/grafana/pkg/services/store/entity"
|
||||
)
|
||||
|
||||
func TestResourceToEntity(t *testing.T) {
|
||||
@ -180,7 +181,6 @@ func TestEntityToResource(t *testing.T) {
|
||||
expectedResourceVersion: "1",
|
||||
expectedUid: "test-guid",
|
||||
expectedAnnotations: map[string]string{
|
||||
"grafana.app/action": "CREATED",
|
||||
"grafana.app/createdBy": "test-created-by",
|
||||
"grafana.app/folder": "test-folder",
|
||||
"grafana.app/slug": "test-slug",
|
||||
|
@ -16,7 +16,6 @@ const AnnoKeyUpdatedTimestamp = "grafana.app/updatedTimestamp"
|
||||
const AnnoKeyUpdatedBy = "grafana.app/updatedBy"
|
||||
const AnnoKeyFolder = "grafana.app/folder"
|
||||
const AnnoKeySlug = "grafana.app/slug"
|
||||
const AnnoKeyAction = "grafana.app/action"
|
||||
|
||||
// Identify where values came from
|
||||
|
||||
@ -58,8 +57,6 @@ type GrafanaResourceMetaAccessor interface {
|
||||
SetFolder(uid string)
|
||||
GetSlug() string
|
||||
SetSlug(v string)
|
||||
GetAction() string
|
||||
SetAction(v string)
|
||||
|
||||
GetOriginInfo() (*ResourceOriginInfo, error)
|
||||
SetOriginInfo(info *ResourceOriginInfo)
|
||||
@ -176,14 +173,6 @@ func (m *grafanaResourceMetaAccessor) SetSlug(v string) {
|
||||
m.set(AnnoKeySlug, v)
|
||||
}
|
||||
|
||||
func (m *grafanaResourceMetaAccessor) GetAction() string {
|
||||
return m.get(AnnoKeyAction)
|
||||
}
|
||||
|
||||
func (m *grafanaResourceMetaAccessor) SetAction(v string) {
|
||||
m.set(AnnoKeyAction, v)
|
||||
}
|
||||
|
||||
func (m *grafanaResourceMetaAccessor) SetOriginInfo(info *ResourceOriginInfo) {
|
||||
anno := m.obj.GetAnnotations()
|
||||
if anno == nil {
|
||||
|
Loading…
Reference in New Issue
Block a user