K8s/Dashboard: Promote from alpha1 to beta1 (#104009)
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
dashboardV1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
||||
"github.com/grafana/grafana/pkg/registry/apis/provisioning/resources"
|
||||
)
|
||||
|
||||
@@ -24,22 +25,24 @@ func TestIntegrationProvisioning_Client(t *testing.T) {
|
||||
|
||||
t.Run("dashboard client support", func(t *testing.T) {
|
||||
_, _, err := clients.ForResource(schema.GroupVersionResource{
|
||||
Group: "dashboard.grafana.app",
|
||||
Group: dashboardV1.GROUP,
|
||||
Version: dashboardV1.VERSION,
|
||||
Resource: "dashboards",
|
||||
Version: "v1alpha1",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
// With empty version, we should get the preferred version (v1alpha1)
|
||||
_, _, err = clients.ForResource(schema.GroupVersionResource{
|
||||
Group: "dashboard.grafana.app",
|
||||
// With empty version, we should get the preferred version (v1beta1)
|
||||
_, gvk, err := clients.ForResource(schema.GroupVersionResource{
|
||||
Group: dashboardV1.GROUP,
|
||||
Resource: "dashboards",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, dashboardV1.VERSION, gvk.Version)
|
||||
require.Equal(t, "Dashboard", gvk.Kind)
|
||||
|
||||
_, _, err = clients.ForKind(schema.GroupVersionKind{
|
||||
Group: "dashboard.grafana.app",
|
||||
Version: "v1alpha1",
|
||||
Group: dashboardV1.GROUP,
|
||||
Version: dashboardV1.VERSION,
|
||||
Kind: "Dashboard",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"apiVersion": "dashboard.grafana.app/v1alpha1",
|
||||
"apiVersion": "dashboard.grafana.app/v1beta1",
|
||||
"kind": "Dashboard",
|
||||
"metadata": {
|
||||
"name": "root_dashboard",
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/client-go/rest"
|
||||
|
||||
dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1"
|
||||
dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
||||
folder "github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1"
|
||||
provisioning "github.com/grafana/grafana/pkg/apis/provisioning/v0alpha1"
|
||||
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
|
||||
|
||||
Reference in New Issue
Block a user