ResourceServer: Add resource server protobuf and wrapper (#90007)

This commit is contained in:
Ryan McKinley
2024-07-09 15:08:13 -07:00
committed by GitHub
parent 05ce16cf7b
commit 079f0715aa
40 changed files with 5852 additions and 62 deletions
+5 -7
View File
@@ -25,6 +25,7 @@ import (
"k8s.io/client-go/rest"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/apimachinery/utils"
"github.com/grafana/grafana/pkg/infra/localcache"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/server"
@@ -158,14 +159,11 @@ func (c *K8sResourceClient) SanitizeJSON(v *unstructured.Unstructured) string {
if anno["grafana.app/originHash"] != "" {
anno["grafana.app/originHash"] = "${originHash}"
}
if anno["grafana.app/updatedTimestamp"] != "" {
anno["grafana.app/updatedTimestamp"] = "${updatedTimestamp}"
}
// Remove annotations that are not added by legacy storage
delete(anno, "grafana.app/originTimestamp")
delete(anno, "grafana.app/createdBy")
delete(anno, "grafana.app/updatedBy")
delete(anno, "grafana.app/action")
delete(anno, utils.AnnoKeyOriginTimestamp)
delete(anno, utils.AnnoKeyCreatedBy)
delete(anno, utils.AnnoKeyUpdatedBy)
delete(anno, utils.AnnoKeyUpdatedTimestamp)
deep.SetAnnotations(anno)
copy := deep.Object
+1 -2
View File
@@ -361,8 +361,7 @@ func doPlaylistTests(t *testing.T, helper *apis.K8sTestHelper) *apis.K8sTestHelp
"metadata": {
"annotations": {
"grafana.app/originPath": "${originPath}",
"grafana.app/originName": "SQL",
"grafana.app/updatedTimestamp": "${updatedTimestamp}"
"grafana.app/originName": "SQL"
},
"creationTimestamp": "${creationTimestamp}",
"name": "` + uid + `",