Skip to content

Commit bae7add

Browse files
Remove unused deprecated remote tracker
Signed-off-by: Danil-Grigorev <[email protected]>
1 parent 0e5d17b commit bae7add

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

cmd/main.go

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
@@ -228,39 +227,11 @@ func setupChecks(mgr ctrl.Manager) {
228227
}
229228

230229
func 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-
258230
if err := (&providercontroller.GenericProviderReconciler{
259231
Provider: &operatorv1.CoreProvider{},
260232
ProviderList: &operatorv1.CoreProviderList{},
261233
Client: mgr.GetClient(),
262234
Config: mgr.GetConfig(),
263-
Tracker: tracker,
264235
WatchConfigSecretChanges: watchConfigSecretChanges,
265236
}).SetupWithManager(mgr, concurrency(concurrencyNumber)); err != nil {
266237
setupLog.Error(err, "unable to create controller", "controller", "CoreProvider")
@@ -272,7 +243,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
272243
ProviderList: &operatorv1.InfrastructureProviderList{},
273244
Client: mgr.GetClient(),
274245
Config: mgr.GetConfig(),
275-
Tracker: tracker,
276246
WatchConfigSecretChanges: watchConfigSecretChanges,
277247
}).SetupWithManager(mgr, concurrency(concurrencyNumber)); err != nil {
278248
setupLog.Error(err, "unable to create controller", "controller", "InfrastructureProvider")
@@ -284,7 +254,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
284254
ProviderList: &operatorv1.BootstrapProviderList{},
285255
Client: mgr.GetClient(),
286256
Config: mgr.GetConfig(),
287-
Tracker: tracker,
288257
WatchConfigSecretChanges: watchConfigSecretChanges,
289258
}).SetupWithManager(mgr, concurrency(concurrencyNumber)); err != nil {
290259
setupLog.Error(err, "unable to create controller", "controller", "BootstrapProvider")
@@ -296,7 +265,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
296265
ProviderList: &operatorv1.ControlPlaneProviderList{},
297266
Client: mgr.GetClient(),
298267
Config: mgr.GetConfig(),
299-
Tracker: tracker,
300268
WatchConfigSecretChanges: watchConfigSecretChanges,
301269
}).SetupWithManager(mgr, concurrency(concurrencyNumber)); err != nil {
302270
setupLog.Error(err, "unable to create controller", "controller", "ControlPlaneProvider")
@@ -308,7 +276,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
308276
ProviderList: &operatorv1.AddonProviderList{},
309277
Client: mgr.GetClient(),
310278
Config: mgr.GetConfig(),
311-
Tracker: tracker,
312279
WatchConfigSecretChanges: watchConfigSecretChanges,
313280
}).SetupWithManager(mgr, concurrency(concurrencyNumber)); err != nil {
314281
setupLog.Error(err, "unable to create controller", "controller", "AddonProvider")
@@ -320,7 +287,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
320287
ProviderList: &operatorv1.IPAMProviderList{},
321288
Client: mgr.GetClient(),
322289
Config: mgr.GetConfig(),
323-
Tracker: tracker,
324290
WatchConfigSecretChanges: watchConfigSecretChanges,
325291
}).SetupWithManager(mgr, concurrency(concurrencyNumber)); err != nil {
326292
setupLog.Error(err, "unable to create controller", "controller", "IPAMProvider")
@@ -332,16 +298,14 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
332298
ProviderList: &operatorv1.RuntimeExtensionProviderList{},
333299
Client: mgr.GetClient(),
334300
Config: mgr.GetConfig(),
335-
Tracker: tracker,
336301
WatchConfigSecretChanges: watchConfigSecretChanges,
337302
}).SetupWithManager(mgr, concurrency(concurrencyNumber)); err != nil {
338303
setupLog.Error(err, "unable to create controller", "controller", "RuntimeExtensionProvider")
339304
os.Exit(1)
340305
}
341306

342307
if err := (&healtchcheckcontroller.ProviderHealthCheckReconciler{
343-
Client: mgr.GetClient(),
344-
Tracker: tracker,
308+
Client: mgr.GetClient(),
345309
}).SetupWithManager(mgr, concurrency(concurrencyNumber)); err != nil {
346310
setupLog.Error(err, "unable to create controller", "controller", "Healthcheck")
347311
os.Exit(1)

internal/controller/genericprovider_controller.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2"
3333
"sigs.k8s.io/cluster-api-operator/internal/controller/genericprovider"
3434
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
35-
"sigs.k8s.io/cluster-api/controllers/remote"
3635
"sigs.k8s.io/cluster-api/util/conditions"
3736
"sigs.k8s.io/cluster-api/util/patch"
3837
ctrl "sigs.k8s.io/controller-runtime"
@@ -48,7 +47,6 @@ type GenericProviderReconciler struct {
4847
ProviderList genericprovider.GenericProviderList
4948
Client client.Client
5049
Config *rest.Config
51-
Tracker *remote.ClusterCacheTracker
5250
WatchConfigSecretChanges bool
5351
}
5452

internal/controller/healthcheck/healthcheck_controller.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
kerrors "k8s.io/apimachinery/pkg/util/errors"
3232
operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2"
3333
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
34-
"sigs.k8s.io/cluster-api/controllers/remote"
3534
"sigs.k8s.io/cluster-api/util/conditions"
3635
"sigs.k8s.io/cluster-api/util/patch"
3736
ctrl "sigs.k8s.io/controller-runtime"
@@ -61,8 +60,7 @@ const providerLabelKey = "cluster.x-k8s.io/provider"
6160
var deploymentPredicate predicate.Predicate
6261

6362
type ProviderHealthCheckReconciler struct {
64-
Client client.Client
65-
Tracker *remote.ClusterCacheTracker
63+
Client client.Client
6664
}
6765

6866
type GenericProviderHealthCheckReconciler struct {

0 commit comments

Comments
 (0)