mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Prevent enabling alpha APIs by default
This commit is contained in:
parent
13b9c9afd3
commit
d8bf50267a
@ -24,6 +24,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
appsapiv1beta1 "k8s.io/api/apps/v1beta1"
|
appsapiv1beta1 "k8s.io/api/apps/v1beta1"
|
||||||
@ -370,3 +371,12 @@ func TestAPIVersionOfDiscoveryEndpoints(t *testing.T) {
|
|||||||
assert.Equal(resourceList.APIVersion, "v1")
|
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
Block a user