@@ -34,7 +34,6 @@ import (
3434 "sigs.k8s.io/cluster-api-operator/internal/webhook"
3535 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3636 clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3"
37- "sigs.k8s.io/cluster-api/controllers/remote"
3837 "sigs.k8s.io/cluster-api/util/flags"
3938 "sigs.k8s.io/cluster-api/version"
4039 ctrl "sigs.k8s.io/controller-runtime"
@@ -55,23 +54,21 @@ var (
5554 setupLog = ctrl .Log .WithName ("setup" )
5655
5756 // flags.
58- enableLeaderElection bool
59- leaderElectionLeaseDuration time.Duration
60- leaderElectionRenewDeadline time.Duration
61- leaderElectionRetryPeriod time.Duration
62- watchFilterValue string
63- watchNamespace string
64- profilerAddress string
65- enableContentionProfiling bool
66- concurrencyNumber int
67- syncPeriod time.Duration
68- clusterCacheTrackerClientQPS float32
69- clusterCacheTrackerClientBurst int
70- webhookPort int
71- webhookCertDir string
72- healthAddr string
73- watchConfigSecretChanges bool
74- managerOptions = flags.ManagerOptions {}
57+ enableLeaderElection bool
58+ leaderElectionLeaseDuration time.Duration
59+ leaderElectionRenewDeadline time.Duration
60+ leaderElectionRetryPeriod time.Duration
61+ watchFilterValue string
62+ watchNamespace string
63+ profilerAddress string
64+ enableContentionProfiling bool
65+ concurrencyNumber int
66+ syncPeriod time.Duration
67+ webhookPort int
68+ webhookCertDir string
69+ healthAddr string
70+ watchConfigSecretChanges bool
71+ managerOptions = flags.ManagerOptions {}
7572)
7673
7774func init () {
@@ -120,12 +117,6 @@ func InitFlags(fs *pflag.FlagSet) {
120117 fs .DurationVar (& syncPeriod , "sync-period" , 10 * time .Minute ,
121118 "The minimum interval at which watched resources are reconciled (e.g. 15m)" )
122119
123- fs .Float32Var (& clusterCacheTrackerClientQPS , "clustercachetracker-client-qps" , 20 ,
124- "Maximum queries per second from the cluster cache tracker clients to the Kubernetes API server of workload clusters." )
125-
126- fs .IntVar (& clusterCacheTrackerClientBurst , "clustercachetracker-client-burst" , 30 ,
127- "Maximum number of queries that should be allowed in one burst from the cluster cache tracker clients to the Kubernetes API server of workload clusters." )
128-
129120 fs .IntVar (& webhookPort , "webhook-port" , 9443 , "Webhook Server port" )
130121
131122 fs .StringVar (& webhookCertDir , "webhook-cert-dir" , "/tmp/k8s-webhook-server/serving-certs/" ,
@@ -228,39 +219,11 @@ func setupChecks(mgr ctrl.Manager) {
228219}
229220
230221func setupReconcilers (mgr ctrl.Manager , watchConfigSecretChanges bool ) {
231- secretCachingClient , err := client .New (mgr .GetConfig (), client.Options {
232- HTTPClient : mgr .GetHTTPClient (),
233- Cache : & client.CacheOptions {
234- Reader : mgr .GetCache (),
235- },
236- })
237- if err != nil {
238- setupLog .Error (err , "unable to create secret caching client" )
239- os .Exit (1 )
240- }
241- // Set up a ClusterCacheTracker and ClusterCacheReconciler to provide to controllers
242- // requiring a connection to a remote cluster
243- tracker , err := remote .NewClusterCacheTracker (
244- mgr ,
245- remote.ClusterCacheTrackerOptions {
246- SecretCachingClient : secretCachingClient ,
247- ControllerName : "cluster-api-operator-controller" ,
248- Log : & ctrl .Log ,
249- ClientQPS : clusterCacheTrackerClientQPS ,
250- ClientBurst : clusterCacheTrackerClientBurst ,
251- },
252- )
253- if err != nil {
254- setupLog .Error (err , "Unable to create cluster cache tracker" )
255- os .Exit (1 )
256- }
257-
258222 if err := (& providercontroller.GenericProviderReconciler {
259223 Provider : & operatorv1.CoreProvider {},
260224 ProviderList : & operatorv1.CoreProviderList {},
261225 Client : mgr .GetClient (),
262226 Config : mgr .GetConfig (),
263- Tracker : tracker ,
264227 WatchConfigSecretChanges : watchConfigSecretChanges ,
265228 }).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
266229 setupLog .Error (err , "unable to create controller" , "controller" , "CoreProvider" )
@@ -272,7 +235,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
272235 ProviderList : & operatorv1.InfrastructureProviderList {},
273236 Client : mgr .GetClient (),
274237 Config : mgr .GetConfig (),
275- Tracker : tracker ,
276238 WatchConfigSecretChanges : watchConfigSecretChanges ,
277239 }).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
278240 setupLog .Error (err , "unable to create controller" , "controller" , "InfrastructureProvider" )
@@ -284,7 +246,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
284246 ProviderList : & operatorv1.BootstrapProviderList {},
285247 Client : mgr .GetClient (),
286248 Config : mgr .GetConfig (),
287- Tracker : tracker ,
288249 WatchConfigSecretChanges : watchConfigSecretChanges ,
289250 }).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
290251 setupLog .Error (err , "unable to create controller" , "controller" , "BootstrapProvider" )
@@ -296,7 +257,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
296257 ProviderList : & operatorv1.ControlPlaneProviderList {},
297258 Client : mgr .GetClient (),
298259 Config : mgr .GetConfig (),
299- Tracker : tracker ,
300260 WatchConfigSecretChanges : watchConfigSecretChanges ,
301261 }).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
302262 setupLog .Error (err , "unable to create controller" , "controller" , "ControlPlaneProvider" )
@@ -308,7 +268,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
308268 ProviderList : & operatorv1.AddonProviderList {},
309269 Client : mgr .GetClient (),
310270 Config : mgr .GetConfig (),
311- Tracker : tracker ,
312271 WatchConfigSecretChanges : watchConfigSecretChanges ,
313272 }).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
314273 setupLog .Error (err , "unable to create controller" , "controller" , "AddonProvider" )
@@ -320,7 +279,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
320279 ProviderList : & operatorv1.IPAMProviderList {},
321280 Client : mgr .GetClient (),
322281 Config : mgr .GetConfig (),
323- Tracker : tracker ,
324282 WatchConfigSecretChanges : watchConfigSecretChanges ,
325283 }).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
326284 setupLog .Error (err , "unable to create controller" , "controller" , "IPAMProvider" )
@@ -332,16 +290,14 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
332290 ProviderList : & operatorv1.RuntimeExtensionProviderList {},
333291 Client : mgr .GetClient (),
334292 Config : mgr .GetConfig (),
335- Tracker : tracker ,
336293 WatchConfigSecretChanges : watchConfigSecretChanges ,
337294 }).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
338295 setupLog .Error (err , "unable to create controller" , "controller" , "RuntimeExtensionProvider" )
339296 os .Exit (1 )
340297 }
341298
342299 if err := (& healtchcheckcontroller.ProviderHealthCheckReconciler {
343- Client : mgr .GetClient (),
344- Tracker : tracker ,
300+ Client : mgr .GetClient (),
345301 }).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
346302 setupLog .Error (err , "unable to create controller" , "controller" , "Healthcheck" )
347303 os .Exit (1 )
0 commit comments