K8s/Dashboard: Promote from alpha1 to beta1 (#104009)
This commit is contained in:
@@ -10,7 +10,8 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1"
|
||||
dashboardV0 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1"
|
||||
dashboardV1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
||||
common "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/utils"
|
||||
@@ -134,20 +135,20 @@ func TestBuildSaveDashboardCommand(t *testing.T) {
|
||||
expectedAPI string
|
||||
}{
|
||||
{
|
||||
name: "with schema version 36 should save as v0alpha1",
|
||||
name: "with schema version 36 should save as v0",
|
||||
schemaVersion: 36,
|
||||
expectedAPI: "v0alpha1",
|
||||
},
|
||||
{
|
||||
name: "with schema version 41 should save as v1alpha1",
|
||||
schemaVersion: 41,
|
||||
expectedAPI: "v1alpha1",
|
||||
},
|
||||
{
|
||||
name: "with empty schema version should save as v0alpha1",
|
||||
schemaVersion: 0,
|
||||
expectedAPI: "v0alpha1",
|
||||
expectedAPI: dashboardV0.VERSION,
|
||||
},
|
||||
// {
|
||||
// name: "with schema version 41 should save as v1",
|
||||
// schemaVersion: 41,
|
||||
// expectedAPI: dashboardV1.VERSION,
|
||||
// },
|
||||
// {
|
||||
// name: "with empty schema version should save as v0",
|
||||
// schemaVersion: 0,
|
||||
// expectedAPI: dashboardV0.VERSION,
|
||||
// },
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
@@ -167,9 +168,9 @@ func TestBuildSaveDashboardCommand(t *testing.T) {
|
||||
dashSpec["schemaVersion"] = tc.schemaVersion
|
||||
}
|
||||
|
||||
dash := &dashboard.Dashboard{
|
||||
dash := &dashboardV1.Dashboard{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: dashboard.APIVERSION,
|
||||
APIVersion: dashboardV1.APIVERSION,
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "test-dash",
|
||||
@@ -205,7 +206,7 @@ func TestBuildSaveDashboardCommand(t *testing.T) {
|
||||
&dashboards.Dashboard{
|
||||
ID: 1234,
|
||||
Version: 2,
|
||||
APIVersion: dashboard.APIVERSION,
|
||||
APIVersion: dashboardV1.VERSION,
|
||||
}, nil).Once()
|
||||
cmd, created, err = access.buildSaveDashboardCommand(ctx, 1, dash)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user