Run defaulting on the scheduler startup

This commit is contained in:
Clayton Coleman
2016-09-30 17:39:47 -04:00
parent 3ee591d7ab
commit 957c0955aa
6 changed files with 13 additions and 3 deletions

View File

@@ -50,8 +50,10 @@ type ProxyServerConfig struct {
}
func NewProxyConfig() *ProxyServerConfig {
versioned := &v1alpha1.KubeProxyConfiguration{}
api.Scheme.Default(versioned)
cfg := componentconfig.KubeProxyConfiguration{}
api.Scheme.Convert(&v1alpha1.KubeProxyConfiguration{}, &cfg, nil)
api.Scheme.Convert(versioned, &cfg, nil)
return &ProxyServerConfig{
KubeProxyConfiguration: cfg,
ContentType: "application/vnd.kubernetes.protobuf",

View File

@@ -64,8 +64,10 @@ type KubeletServer struct {
// NewKubeletServer will create a new KubeletServer with default values.
func NewKubeletServer() *KubeletServer {
versioned := &v1alpha1.KubeletConfiguration{}
api.Scheme.Default(versioned)
config := componentconfig.KubeletConfiguration{}
api.Scheme.Convert(&v1alpha1.KubeletConfiguration{}, &config, nil)
api.Scheme.Convert(versioned, &config, nil)
return &KubeletServer{
KubeConfig: flag.NewStringFlag("/var/lib/kubelet/kubeconfig"),
RequireKubeConfig: false, // in 1.5, default to true

View File

@@ -246,6 +246,7 @@ func initKubeletConfigSync(s *options.KubeletServer) (*componentconfig.KubeletCo
if err != nil {
return nil, err
}
api.Scheme.Default(&extKC)
kc := componentconfig.KubeletConfiguration{}
err = api.Scheme.Convert(&extKC, &kc, nil)
if err != nil {