mirror of https://github.com/k3s-io/k3s
Prevent enabling alpha APIs by default
parent
13b9c9afd3
commit
d8bf50267a
|
@ -24,6 +24,7 @@ import (
|
|||
"net/http"
|
||||
"net/http/httptest"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
appsapiv1beta1 "k8s.io/api/apps/v1beta1"
|
||||
|
@ -370,3 +371,12 @@ func TestAPIVersionOfDiscoveryEndpoints(t *testing.T) {
|
|||
assert.Equal(resourceList.APIVersion, "v1")
|
||||
|
||||
}
|
||||
|
||||
func TestNoAlphaVersionsEnabledByDefault(t *testing.T) {
|
||||
config := DefaultAPIResourceConfigSource()
|
||||
for gv, gvConfig := range config.GroupVersionResourceConfigs {
|
||||
if gvConfig.Enable && strings.Contains(gv.Version, "alpha") {
|
||||
t.Errorf("Alpha API version %s enabled by default", gv.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue