From d8bf50267ab6b43a4afef95dfb5f4d195ac1b175 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Tue, 5 Sep 2017 21:51:04 -0400 Subject: [PATCH] Prevent enabling alpha APIs by default --- pkg/master/master_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/master/master_test.go b/pkg/master/master_test.go index 11ec1e0a01b..80523a5c2dc 100644 --- a/pkg/master/master_test.go +++ b/pkg/master/master_test.go @@ -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()) + } + } +}