remove unnecessary fields from generic apiserver

This commit is contained in:
deads2k 2016-08-22 16:38:19 -04:00
parent 0f8869d308
commit b1ebeffeb3
2 changed files with 14 additions and 31 deletions

View File

@ -58,7 +58,6 @@ import (
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/ui" "k8s.io/kubernetes/pkg/ui"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/async"
"k8s.io/kubernetes/pkg/util/crypto" "k8s.io/kubernetes/pkg/util/crypto"
utilnet "k8s.io/kubernetes/pkg/util/net" utilnet "k8s.io/kubernetes/pkg/util/net"
utilruntime "k8s.io/kubernetes/pkg/util/runtime" utilruntime "k8s.io/kubernetes/pkg/util/runtime"
@ -210,22 +209,17 @@ type GenericAPIServer struct {
// "Inputs", Copied from Config // "Inputs", Copied from Config
ServiceClusterIPRange *net.IPNet ServiceClusterIPRange *net.IPNet
ServiceNodePortRange utilnet.PortRange ServiceNodePortRange utilnet.PortRange
cacheTimeout time.Duration
MinRequestTimeout time.Duration MinRequestTimeout time.Duration
mux apiserver.Mux mux apiserver.Mux
MuxHelper *apiserver.MuxHelper MuxHelper *apiserver.MuxHelper
HandlerContainer *restful.Container HandlerContainer *restful.Container
RootWebService *restful.WebService RootWebService *restful.WebService
enableLogsSupport bool
enableUISupport bool
enableSwaggerSupport bool enableSwaggerSupport bool
enableSwaggerUI bool enableSwaggerUI bool
enableProfiling bool
enableWatchCache bool enableWatchCache bool
APIPrefix string APIPrefix string
APIGroupPrefix string APIGroupPrefix string
corsAllowedOriginList []string
authenticator authenticator.Request authenticator authenticator.Request
authorizer authorizer.Authorizer authorizer authorizer.Authorizer
AdmissionControl admission.Interface AdmissionControl admission.Interface
@ -240,7 +234,6 @@ type GenericAPIServer struct {
PublicReadWritePort int PublicReadWritePort int
ServiceReadWriteIP net.IP ServiceReadWriteIP net.IP
ServiceReadWritePort int ServiceReadWritePort int
masterServices *async.Runner
ExtraServicePorts []api.ServicePort ExtraServicePorts []api.ServicePort
ExtraEndpointPorts []api.EndpointPort ExtraEndpointPorts []api.EndpointPort
@ -366,22 +359,17 @@ func New(c *Config) (*GenericAPIServer, error) {
ServiceClusterIPRange: c.ServiceClusterIPRange, ServiceClusterIPRange: c.ServiceClusterIPRange,
ServiceNodePortRange: c.ServiceNodePortRange, ServiceNodePortRange: c.ServiceNodePortRange,
RootWebService: new(restful.WebService), RootWebService: new(restful.WebService),
enableLogsSupport: c.EnableLogsSupport,
enableUISupport: c.EnableUISupport,
enableSwaggerSupport: c.EnableSwaggerSupport, enableSwaggerSupport: c.EnableSwaggerSupport,
enableSwaggerUI: c.EnableSwaggerUI, enableSwaggerUI: c.EnableSwaggerUI,
enableProfiling: c.EnableProfiling,
enableWatchCache: c.EnableWatchCache, enableWatchCache: c.EnableWatchCache,
APIPrefix: c.APIPrefix, APIPrefix: c.APIPrefix,
APIGroupPrefix: c.APIGroupPrefix, APIGroupPrefix: c.APIGroupPrefix,
corsAllowedOriginList: c.CorsAllowedOriginList,
authenticator: c.Authenticator, authenticator: c.Authenticator,
authorizer: c.Authorizer, authorizer: c.Authorizer,
AdmissionControl: c.AdmissionControl, AdmissionControl: c.AdmissionControl,
RequestContextMapper: c.RequestContextMapper, RequestContextMapper: c.RequestContextMapper,
Serializer: c.Serializer, Serializer: c.Serializer,
cacheTimeout: c.CacheTimeout,
MinRequestTimeout: time.Duration(c.MinRequestTimeout) * time.Second, MinRequestTimeout: time.Duration(c.MinRequestTimeout) * time.Second,
MasterCount: c.MasterCount, MasterCount: c.MasterCount,

View File

@ -76,19 +76,14 @@ func TestNew(t *testing.T) {
defer etcdserver.Terminate(t) defer etcdserver.Terminate(t)
// Verify many of the variables match their config counterparts // Verify many of the variables match their config counterparts
assert.Equal(s.enableLogsSupport, config.EnableLogsSupport)
assert.Equal(s.enableUISupport, config.EnableUISupport)
assert.Equal(s.enableSwaggerSupport, config.EnableSwaggerSupport) assert.Equal(s.enableSwaggerSupport, config.EnableSwaggerSupport)
assert.Equal(s.enableSwaggerUI, config.EnableSwaggerUI) assert.Equal(s.enableSwaggerUI, config.EnableSwaggerUI)
assert.Equal(s.enableProfiling, config.EnableProfiling)
assert.Equal(s.APIPrefix, config.APIPrefix) assert.Equal(s.APIPrefix, config.APIPrefix)
assert.Equal(s.APIGroupPrefix, config.APIGroupPrefix) assert.Equal(s.APIGroupPrefix, config.APIGroupPrefix)
assert.Equal(s.corsAllowedOriginList, config.CorsAllowedOriginList)
assert.Equal(s.authenticator, config.Authenticator) assert.Equal(s.authenticator, config.Authenticator)
assert.Equal(s.authorizer, config.Authorizer) assert.Equal(s.authorizer, config.Authorizer)
assert.Equal(s.AdmissionControl, config.AdmissionControl) assert.Equal(s.AdmissionControl, config.AdmissionControl)
assert.Equal(s.RequestContextMapper, config.RequestContextMapper) assert.Equal(s.RequestContextMapper, config.RequestContextMapper)
assert.Equal(s.cacheTimeout, config.CacheTimeout)
assert.Equal(s.ExternalAddress, config.ExternalHost) assert.Equal(s.ExternalAddress, config.ExternalHost)
assert.Equal(s.ClusterIP, config.PublicAddress) assert.Equal(s.ClusterIP, config.PublicAddress)
assert.Equal(s.PublicReadWritePort, config.ReadWritePort) assert.Equal(s.PublicReadWritePort, config.ReadWritePort)