make v1 enabled by default

This commit is contained in:
Chao Xu 2015-06-04 11:37:44 -07:00
parent 02f3142f41
commit ef61b031f5
9 changed files with 8 additions and 20 deletions

View File

@ -164,7 +164,6 @@ func startComponents(firstManifestURL, secondManifestURL, apiVersion string) (st
ReadWritePort: portNumber,
PublicAddress: publicAddress,
CacheTimeout: 2 * time.Second,
EnableV1: true,
})
handler.delegate = m.Handler

View File

@ -282,8 +282,10 @@ func (s *APIServer) Run(_ []string) error {
disableV1beta3 := disableAllAPIs
disableV1beta3 = !s.getRuntimeConfigValue("api/v1beta3", !disableV1beta3)
// V1 is disabled by default. Users can enable it using "api/v1={true}".
_, enableV1 := s.RuntimeConfig["api/v1"]
// "api/v1={true|false} allows users to enable/disable v1 API.
// This takes preference over api/all and api/legacy, if specified.
disableV1 := disableAllAPIs
disableV1 = !s.getRuntimeConfigValue("api/v1", !disableV1)
// TODO: expose same flags as client.BindClientConfigFlags but for a server
clientConfig := &client.Config{
@ -371,7 +373,7 @@ func (s *APIServer) Run(_ []string) error {
Authorizer: authorizer,
AdmissionControl: admissionController,
DisableV1Beta3: disableV1beta3,
EnableV1: enableV1,
DisableV1: disableV1,
MasterServiceNamespace: s.MasterServiceNamespace,
ClusterName: s.ClusterName,
ExternalHost: s.ExternalHost,

View File

@ -91,8 +91,8 @@ type Config struct {
EnableSwaggerSupport bool
// allow v1beta3 to be conditionally disabled
DisableV1Beta3 bool
// allow v1 to be conditionally enabled
EnableV1 bool
// allow v1 to be conditionally disabled
DisableV1 bool
// allow downstream consumers to disable the index route
EnableIndex bool
EnableProfiling bool
@ -313,7 +313,7 @@ func New(c *Config) *Master {
authorizer: c.Authorizer,
admissionControl: c.AdmissionControl,
v1beta3: !c.DisableV1Beta3,
v1: c.EnableV1,
v1: !c.DisableV1,
requestContextMapper: c.RequestContextMapper,
cacheTimeout: c.CacheTimeout,

View File

@ -397,7 +397,6 @@ func TestAuthModeAlwaysAllow(t *testing.T) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
transport := http.DefaultTransport
@ -538,7 +537,6 @@ func TestAuthModeAlwaysDeny(t *testing.T) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysDenyAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
transport := http.DefaultTransport
@ -607,7 +605,6 @@ func TestAliceNotForbiddenOrUnauthorized(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: allowAliceAuthorizer{},
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
previousResourceVersion := make(map[string]float64)
@ -695,7 +692,6 @@ func TestBobIsForbidden(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: allowAliceAuthorizer{},
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
transport := http.DefaultTransport
@ -757,7 +753,6 @@ func TestUnknownUserIsUnauthorized(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: allowAliceAuthorizer{},
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
transport := http.DefaultTransport
@ -838,7 +833,6 @@ func TestNamespaceAuthorization(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: a,
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
previousResourceVersion := make(map[string]float64)
@ -954,7 +948,6 @@ func TestKindAuthorization(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: a,
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
previousResourceVersion := make(map[string]float64)
@ -1057,7 +1050,6 @@ func TestReadOnlyAuthorization(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: a,
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
transport := http.DefaultTransport

View File

@ -272,7 +272,6 @@ func RunAMaster(t *testing.T) (*master.Master, *httptest.Server) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {

View File

@ -75,7 +75,6 @@ func TestUnschedulableNodes(t *testing.T) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
restClient := client.NewOrDie(&client.Config{Host: s.URL, Version: testapi.Version()})

View File

@ -68,7 +68,6 @@ func TestSecrets(t *testing.T) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
framework.DeleteAllEtcdKeys()

View File

@ -419,7 +419,6 @@ func startServiceAccountTestServer(t *testing.T) (*client.Client, client.Config,
Authenticator: authenticator,
Authorizer: authorizer,
AdmissionControl: serviceAccountAdmission,
EnableV1: true,
})
// Start the service account and service account token controllers

View File

@ -82,7 +82,6 @@ func runAMaster(t *testing.T) (*master.Master, *httptest.Server) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {