Commit 14f7b959 authored by stewart-yu's avatar stewart-yu

modify cloud-controller manager config struct to adapt option change

parent bbb48fd0
...@@ -17,25 +17,39 @@ limitations under the License. ...@@ -17,25 +17,39 @@ limitations under the License.
package app package app
import ( import (
"time" apiserver "k8s.io/apiserver/pkg/server"
clientset "k8s.io/client-go/kubernetes"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/record"
genericcontrollermanager "k8s.io/kubernetes/cmd/controller-manager/app" genericcontrollermanager "k8s.io/kubernetes/cmd/controller-manager/app"
"k8s.io/kubernetes/pkg/apis/componentconfig"
) )
// ExtraConfig are part of Config, also can place your custom config here.
type ExtraConfig struct {
NodeStatusUpdateFrequency time.Duration
}
// Config is the main context object for the cloud controller manager. // Config is the main context object for the cloud controller manager.
type Config struct { type Config struct {
Generic genericcontrollermanager.Config ComponentConfig componentconfig.CloudControllerManagerConfiguration
Extra ExtraConfig
SecureServing *apiserver.SecureServingInfo
// TODO: remove deprecated insecure serving
InsecureServing *genericcontrollermanager.InsecureServingInfo
Authentication apiserver.AuthenticationInfo
Authorization apiserver.AuthorizationInfo
// the general kube client
Client *clientset.Clientset
// the client only used for leader election
LeaderElectionClient *clientset.Clientset
// the rest config for the master
Kubeconfig *restclient.Config
// the event sink
EventRecorder record.EventRecorder
} }
type completedConfig struct { type completedConfig struct {
Generic genericcontrollermanager.CompletedConfig *Config
Extra *ExtraConfig
} }
// CompletedConfig same as Config, just to swap private object. // CompletedConfig same as Config, just to swap private object.
...@@ -46,10 +60,6 @@ type CompletedConfig struct { ...@@ -46,10 +60,6 @@ type CompletedConfig struct {
// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver. // Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.
func (c *Config) Complete() *CompletedConfig { func (c *Config) Complete() *CompletedConfig {
cc := completedConfig{ cc := completedConfig{c}
c.Generic.Complete(),
&c.Extra,
}
return &CompletedConfig{&cc} return &CompletedConfig{&cc}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment