Skip to content

Commit

Permalink
Merge pull request kubernetes#9269 from caesarxuchao/make-v1-enabled-…
Browse files Browse the repository at this point in the history
…by-default

Make v1 enabled by default
  • Loading branch information
Quinton Hoole committed Jun 4, 2015
2 parents 44f2c8f + 21bea6e commit 5214465
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 21 deletions.
1 change: 0 additions & 1 deletion cmd/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 5 additions & 3 deletions cmd/kube-apiserver/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion hack/update-swagger-spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ kube::log::status "Starting kube-apiserver"
--etcd_servers="http://${ETCD_HOST}:${ETCD_PORT}" \
--public_address_override="127.0.0.1" \
--kubelet_port=${KUBELET_PORT} \
--runtime_config=api/v1 \
--runtime_config=api/legacy=false \
--service-cluster-ip-range="10.0.0.0/24" 1>&2 &
APISERVER_PID=$!
Expand Down
6 changes: 3 additions & 3 deletions pkg/master/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 0 additions & 8 deletions test/integration/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ func TestAuthModeAlwaysAllow(t *testing.T) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})

transport := http.DefaultTransport
Expand Down Expand Up @@ -538,7 +537,6 @@ func TestAuthModeAlwaysDeny(t *testing.T) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysDenyAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})

transport := http.DefaultTransport
Expand Down Expand Up @@ -607,7 +605,6 @@ func TestAliceNotForbiddenOrUnauthorized(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: allowAliceAuthorizer{},
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})

previousResourceVersion := make(map[string]float64)
Expand Down Expand Up @@ -695,7 +692,6 @@ func TestBobIsForbidden(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: allowAliceAuthorizer{},
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})

transport := http.DefaultTransport
Expand Down Expand Up @@ -757,7 +753,6 @@ func TestUnknownUserIsUnauthorized(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: allowAliceAuthorizer{},
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})

transport := http.DefaultTransport
Expand Down Expand Up @@ -838,7 +833,6 @@ func TestNamespaceAuthorization(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: a,
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})

previousResourceVersion := make(map[string]float64)
Expand Down Expand Up @@ -954,7 +948,6 @@ func TestKindAuthorization(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: a,
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})

previousResourceVersion := make(map[string]float64)
Expand Down Expand Up @@ -1057,7 +1050,6 @@ func TestReadOnlyAuthorization(t *testing.T) {
Authenticator: getTestTokenAuth(),
Authorizer: a,
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})

transport := http.DefaultTransport
Expand Down
1 change: 0 additions & 1 deletion test/integration/framework/master_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion test/integration/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()})
Expand Down
1 change: 0 additions & 1 deletion test/integration/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func TestSecrets(t *testing.T) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})

framework.DeleteAllEtcdKeys()
Expand Down
1 change: 0 additions & 1 deletion test/integration/service_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion test/integration/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5214465

Please sign in to comment.