@@ -69,10 +69,19 @@ func newKubeVipCloudProvider(io.Reader) (cloudprovider.Interface, error) {
69
69
ns = KubeVipClientConfigNamespace
70
70
}
71
71
72
- enableLBClass , err := strconv .ParseBool (lbc )
73
- if err != nil {
74
- return nil , fmt .Errorf ("error creating kubernetes client config: %s" , err .Error ())
72
+ var (
73
+ enableLBClass bool
74
+ err error
75
+ )
76
+
77
+ if len (lbc ) > 0 {
78
+ klog .Infof ("Checking if loadbalancerClass is enabled: %s" , lbc )
79
+ enableLBClass , err = strconv .ParseBool (lbc )
80
+ if err != nil {
81
+ return nil , fmt .Errorf ("error parsing value of %s: %s" , EnableLoadbalancerClassEnvKey , err .Error ())
82
+ }
75
83
}
84
+ klog .Infof ("staring with loadbalancerClass set to: %t" , enableLBClass )
76
85
77
86
klog .Infof ("Watching configMap for pool config with name: '%s', namespace: '%s'" , cm , ns )
78
87
@@ -117,7 +126,8 @@ func (p *KubeVipCloudProvider) Initialize(clientBuilder cloudprovider.Controller
117
126
sharedInformer := informers .NewSharedInformerFactory (clientset , 0 )
118
127
119
128
if p .enableLBClass {
120
- klog .V (0 ).Info ("staring controllers to enable service controller that only monitors service with loadbalancerClass" )
129
+ klog .V (0 ).Info ("staring a seperate service controller that only monitors service with loadbalancerClass" )
130
+ klog .V (0 ).Info ("default cloud-provider service controller will ignore service with loadbalancerClass" )
121
131
controller := newLoadbalancerClassServiceController (sharedInformer , p .kubeClient , p .configMapName , p .namespace )
122
132
go controller .Run (context .Background ().Done ())
123
133
}
0 commit comments