Skip to content

Commit

Permalink
Repurposing enableV1beta3 to disableV1beta3 in master config to enabl…
Browse files Browse the repository at this point in the history
…e v1beta3 by default
  • Loading branch information
nikhiljindal committed Mar 30, 2015
1 parent a2801a5 commit 478b7d5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion cmd/integration/integration.go
Expand Up @@ -194,7 +194,6 @@ func startComponents(firstManifestURL, secondManifestURL, apiVersion string) (st
ReadOnlyPort: portNumber,
PublicAddress: publicAddress,
CacheTimeout: 2 * time.Second,
EnableV1Beta3: true,
})
handler.delegate = m.Handler

Expand Down
8 changes: 6 additions & 2 deletions cmd/kube-apiserver/app/server.go
Expand Up @@ -199,7 +199,11 @@ func (s *APIServer) Run(_ []string) error {
glog.Fatalf("Failure to start kubelet client: %v", err)
}

_, v1beta3 := s.RuntimeConfig["api/v1beta3"]
disableV1beta3 := false
v1beta3FlagValue, ok := s.RuntimeConfig["api/v1beta3"]
if ok && v1beta3FlagValue == "false" {
disableV1beta3 = true
}

// TODO: expose same flags as client.BindClientConfigFlags but for a server
clientConfig := &client.Config{
Expand Down Expand Up @@ -274,7 +278,7 @@ func (s *APIServer) Run(_ []string) error {
Authenticator: authenticator,
Authorizer: authorizer,
AdmissionControl: admissionController,
EnableV1Beta3: v1beta3,
DisableV1Beta3: disableV1beta3,
MasterServiceNamespace: s.MasterServiceNamespace,
ClusterName: s.ClusterName,
ExternalHost: s.ExternalHost,
Expand Down
8 changes: 4 additions & 4 deletions pkg/master/master.go
Expand Up @@ -78,8 +78,8 @@ type Config struct {
EnableUISupport bool
// allow downstream consumers to disable swagger
EnableSwaggerSupport bool
// allow v1beta3 to be conditionally enabled
EnableV1Beta3 bool
// allow v1beta3 to be conditionally disabled
DisableV1Beta3 bool
// allow downstream consumers to disable the index route
EnableIndex bool
EnableProfiling bool
Expand Down Expand Up @@ -277,7 +277,7 @@ func New(c *Config) *Master {
authenticator: c.Authenticator,
authorizer: c.Authorizer,
admissionControl: c.AdmissionControl,
v1beta3: c.EnableV1Beta3,
v1beta3: !c.DisableV1Beta3,
requestContextMapper: c.RequestContextMapper,

cacheTimeout: c.CacheTimeout,
Expand Down Expand Up @@ -409,7 +409,7 @@ func (m *Master) init(c *Config) {
if err := m.api_v1beta2().InstallREST(m.handlerContainer); err != nil {
glog.Fatalf("Unable to setup API v1beta2: %v", err)
}
if c.EnableV1Beta3 {
if m.v1beta3 {
if err := m.api_v1beta3().InstallREST(m.handlerContainer); err != nil {
glog.Fatalf("Unable to setup API v1beta3: %v", err)
}
Expand Down
1 change: 0 additions & 1 deletion test/integration/client_test.go
Expand Up @@ -55,7 +55,6 @@ func TestClient(t *testing.T) {
EnableLogsSupport: false,
EnableProfiling: true,
EnableUISupport: false,
EnableV1Beta3: true,
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
Expand Down

0 comments on commit 478b7d5

Please sign in to comment.