Chore: serverConfig.EffectiveVersion earlier in initialization (#110798)
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/version"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/tests/testinfra"
|
||||
@@ -34,10 +35,14 @@ func TestIntegrationOpenAPIs(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("check valid version response", func(t *testing.T) {
|
||||
disco := h.NewDiscoveryClient()
|
||||
info, err := disco.ServerVersion()
|
||||
client, err := kubernetes.NewForConfig(h.NewAdminRestConfig())
|
||||
require.NoError(t, err)
|
||||
|
||||
info, err := client.ServerVersion()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, runtime.Version(), info.GoVersion)
|
||||
require.Equal(t, "1", info.Major)
|
||||
require.Equal(t, "33", info.Minor)
|
||||
|
||||
// Make sure the gitVersion is parsable
|
||||
v, err := version.Parse(info.GitVersion)
|
||||
@@ -50,6 +55,7 @@ func TestIntegrationOpenAPIs(t *testing.T) {
|
||||
// Removing the explicit `OneOf` properties from InlineSecureValue in:
|
||||
// https://github.com/grafana/grafana/blob/main/pkg/apimachinery/apis/common/v0alpha1/secure_values.go#L78
|
||||
// will consistently support V2, however kubectl and everything else continues to work
|
||||
disco := h.NewDiscoveryClient()
|
||||
paths, err := disco.OpenAPIV3().Paths()
|
||||
|
||||
require.NoError(t, err, "requesting OpenAPI v3")
|
||||
|
||||
Reference in New Issue
Block a user