Skip to content

Commit 485b04a

Browse files
zhujian7claude
andcommitted
Remove unused mcaLister field
Since we now use managedClusterAddonIndexer for efficient lookup, the mcaLister field is no longer needed. This cleanup reduces memory usage and simplifies the controller structure. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> Signed-off-by: zhujian <[email protected]>
1 parent a5ead9c commit 485b04a

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

pkg/addon/controllers/addontemplate/controller.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ type addonTemplateController struct {
5252
workClient workv1client.Interface
5353
kubeClient kubernetes.Interface
5454
cmaLister addonlisterv1alpha1.ClusterManagementAddOnLister
55-
mcaLister addonlisterv1alpha1.ManagedClusterAddOnLister
5655
managedClusterAddonIndexer cache.Indexer
5756
addonInformers addoninformers.SharedInformerFactory
5857
clusterInformers clusterv1informers.SharedInformerFactory
@@ -83,7 +82,6 @@ func NewAddonTemplateController(
8382
addonClient: addonClient,
8483
workClient: workClient,
8584
cmaLister: addonInformers.Addon().V1alpha1().ClusterManagementAddOns().Lister(),
86-
mcaLister: addonInformers.Addon().V1alpha1().ManagedClusterAddOns().Lister(),
8785
managedClusterAddonIndexer: addonInformers.Addon().V1alpha1().ManagedClusterAddOns().Informer().GetIndexer(),
8886
addonManagers: make(map[string]context.CancelFunc),
8987
addonInformers: addonInformers,

pkg/addon/controllers/addontemplate/controller_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ func TestStopUnusedManagers(t *testing.T) {
375375
addonClient: fakeAddonClient,
376376
workClient: fakeWorkClient,
377377
cmaLister: addonInformers.Addon().V1alpha1().ClusterManagementAddOns().Lister(),
378-
mcaLister: addonInformers.Addon().V1alpha1().ManagedClusterAddOns().Lister(),
379378
managedClusterAddonIndexer: addonInformers.Addon().V1alpha1().ManagedClusterAddOns().Informer().GetIndexer(),
380379
addonManagers: existingManagers,
381380
addonInformers: addonInformers,

0 commit comments

Comments
 (0)