mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
[cloud-controller manager]get rid of GenericControllerManagerOptions sub-struct
This commit is contained in:
@@ -33,6 +33,22 @@ type GenericComponentConfigOptions struct {
|
||||
LeaderElection componentconfig.LeaderElectionConfiguration
|
||||
}
|
||||
|
||||
// NewGenericComponentConfigOptions returns generic configuration default values for both
|
||||
// the kube-controller-manager and the cloud-contoller-manager. Any common changes should
|
||||
// be made here. Any individual changes should be made in that controller.
|
||||
func NewGenericComponentConfigOptions(cfg componentconfig.GenericComponentConfiguration) *GenericComponentConfigOptions {
|
||||
o := &GenericComponentConfigOptions{
|
||||
MinResyncPeriod: cfg.MinResyncPeriod,
|
||||
ContentType: cfg.ContentType,
|
||||
KubeAPIQPS: cfg.KubeAPIQPS,
|
||||
KubeAPIBurst: cfg.KubeAPIBurst,
|
||||
ControllerStartInterval: cfg.ControllerStartInterval,
|
||||
LeaderElection: cfg.LeaderElection,
|
||||
}
|
||||
|
||||
return o
|
||||
}
|
||||
|
||||
// AddFlags adds flags related to generic for controller manager to the specified FlagSet.
|
||||
func (o *GenericComponentConfigOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
if o == nil {
|
||||
|
@@ -40,6 +40,22 @@ type KubeCloudSharedOptions struct {
|
||||
NodeSyncPeriod metav1.Duration
|
||||
}
|
||||
|
||||
// NewKubeCloudSharedOptions returns common/default configuration values for both
|
||||
// the kube-controller-manager and the cloud-contoller-manager. Any common changes should
|
||||
// be made here. Any individual changes should be made in that controller.
|
||||
func NewKubeCloudSharedOptions(cfg componentconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions {
|
||||
o := &KubeCloudSharedOptions{
|
||||
Port: cfg.Port,
|
||||
Address: cfg.Address,
|
||||
RouteReconciliationPeriod: cfg.RouteReconciliationPeriod,
|
||||
NodeMonitorPeriod: cfg.NodeMonitorPeriod,
|
||||
ClusterName: cfg.ClusterName,
|
||||
ConfigureCloudRoutes: cfg.ConfigureCloudRoutes,
|
||||
}
|
||||
|
||||
return o
|
||||
}
|
||||
|
||||
// AddFlags adds flags related to shared variable for controller manager to the specified FlagSet.
|
||||
func (o *KubeCloudSharedOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
if o == nil {
|
||||
|
Reference in New Issue
Block a user