Dashboards API: v2alpha2 missing pieces (#108293)
* Dashboards API: v2alpha2 missing pieces * Fix issue with dashboard client scope for alpha versions As we now have 2 different alpha versions for v2 we need to store the clients separately. * Improve debuggability of provisioning export test - Add a helper function to print the tree structure. - Be explicit about the expected file names expected in each case. * Update pkg/registry/apis/dashboard/mutate.go * Update pkg/services/authz/zanzana/server/server.go Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com> * Review * go lint --------- Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com> Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com> Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
This commit is contained in:
co-authored by
Igor Suleymanov
Roberto Jimenez Sanchez
Stephanie Hingtgen
parent
eeb44c1d63
commit
d72a70d246
@@ -16,7 +16,8 @@ import (
|
||||
|
||||
dashboardV0 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1"
|
||||
dashboardV1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
||||
dashboardV2 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
|
||||
dashboardV2alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
|
||||
dashboardV2alpha2 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha2"
|
||||
foldersV1 "github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1"
|
||||
"github.com/grafana/grafana/pkg/apiserver/rest"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
@@ -345,11 +346,29 @@ func runDashboardValidationTests(t *testing.T, ctx TestContext) {
|
||||
},
|
||||
{
|
||||
name: "v2alpha1 dashboard with correct spec should not throw on v2",
|
||||
resourceInfo: dashboardV2.DashboardResourceInfo,
|
||||
resourceInfo: dashboardV2alpha1.DashboardResourceInfo,
|
||||
expectSpecErr: false,
|
||||
testObject: &unstructured.Unstructured{
|
||||
Object: map[string]interface{}{
|
||||
"apiVersion": dashboardV2.DashboardResourceInfo.TypeMeta().APIVersion,
|
||||
"apiVersion": dashboardV2alpha1.DashboardResourceInfo.TypeMeta().APIVersion,
|
||||
"kind": "Dashboard",
|
||||
"metadata": map[string]interface{}{
|
||||
"generateName": "test-",
|
||||
},
|
||||
"spec": map[string]interface{}{
|
||||
"title": "Dashboard Title",
|
||||
"description": "valid description",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "v2alpha2 dashboard with correct spec should not throw on v2",
|
||||
resourceInfo: dashboardV2alpha2.DashboardResourceInfo,
|
||||
expectSpecErr: false,
|
||||
testObject: &unstructured.Unstructured{
|
||||
Object: map[string]interface{}{
|
||||
"apiVersion": dashboardV2alpha2.DashboardResourceInfo.TypeMeta().APIVersion,
|
||||
"kind": "Dashboard",
|
||||
"metadata": map[string]interface{}{
|
||||
"generateName": "test-",
|
||||
|
||||
Reference in New Issue
Block a user