refactor(unified-storage): move generated protos to own pkg (#105356)

This commit is contained in:
Jean-Philippe Quéméner
2025-05-15 21:36:52 +02:00
committed by GitHub
parent aa2cf8e398
commit 002f46736a
150 changed files with 4284 additions and 3863 deletions
+5 -4
View File
@@ -10,6 +10,7 @@ import (
"github.com/grafana/grafana/pkg/apimachinery/utils"
"github.com/grafana/grafana/pkg/storage/unified/resource"
"github.com/grafana/grafana/pkg/storage/unified/resourcepb"
)
func TestParquetWriteThenRead(t *testing.T) {
@@ -75,7 +76,7 @@ func TestParquetWriteThenRead(t *testing.T) {
require.NoError(t, err)
for reader.Next() {
req := reader.Request()
keys = append(keys, req.Key.SearchID())
keys = append(keys, resource.SearchID(req.Key))
}
// Verify that we read all values
@@ -101,14 +102,14 @@ func TestParquetWriteThenRead(t *testing.T) {
require.NoError(t, err)
for reader.Next() {
req := reader.Request()
keys = append(keys, req.Key.SearchID())
keys = append(keys, resource.SearchID(req.Key))
}
require.NoError(t, reader.err)
require.Empty(t, keys)
})
}
func toKeyAndBytes(ctx context.Context, group string, res string, obj *unstructured.Unstructured) (context.Context, *resource.ResourceKey, []byte) {
func toKeyAndBytes(ctx context.Context, group string, res string, obj *unstructured.Unstructured) (context.Context, *resourcepb.ResourceKey, []byte) {
if obj.GetKind() == "" {
obj.SetKind(res)
}
@@ -116,7 +117,7 @@ func toKeyAndBytes(ctx context.Context, group string, res string, obj *unstructu
obj.SetAPIVersion(group + "/vXyz")
}
data, _ := obj.MarshalJSON()
return ctx, &resource.ResourceKey{
return ctx, &resourcepb.ResourceKey{
Namespace: obj.GetNamespace(),
Resource: res,
Group: group,