diff --git a/addons/setup/addon_setup.go b/addons/setup/addon_setup.go index 503859df..4b0218c6 100644 --- a/addons/setup/addon_setup.go +++ b/addons/setup/addon_setup.go @@ -68,10 +68,6 @@ type TokenExchangeAddon struct { Addons } -type MaintainenceAddon struct { - Addons -} - // Manifests generates manifestworks to deploy the token exchange addon agent on the managed cluster func (a *Addons) Manifests(cluster *clusterv1.ManagedCluster, addon *addonapiv1alpha1.ManagedClusterAddOn) ([]runtime.Object, error) { objects := []runtime.Object{} diff --git a/addons/setup/common.go b/addons/setup/common.go index 8d1f80b4..a971c767 100644 --- a/addons/setup/common.go +++ b/addons/setup/common.go @@ -10,7 +10,6 @@ import ( ) const ( - MaintainAgentName = "maintenance" TokenExchangeName = "tokenexchange" ) diff --git a/controllers/manager.go b/controllers/manager.go index dfcf1af3..3a9c99bb 100644 --- a/controllers/manager.go +++ b/controllers/manager.go @@ -172,7 +172,6 @@ func (o *ManagerOptions) runManager() { logger.Info("Failed to get owner reference (falling back to namespace)", "error", err) } teEventRecorder := events.NewKubeRecorder(kubeClient.CoreV1().Events(namespace), setup.TokenExchangeName, controllerRef) - mEventRecorder := events.NewKubeRecorder(kubeClient.CoreV1().Events(namespace), setup.MaintainAgentName, controllerRef) agentImage := os.Getenv("TOKEN_EXCHANGE_IMAGE") @@ -189,19 +188,6 @@ func (o *ManagerOptions) runManager() { AddonName: setup.TokenExchangeName}, } - maintainenceModeAddon := setup.MaintainenceAddon{ - Addons: struct { - KubeClient kubernetes.Interface - Recorder events.Recorder - AgentImage string - AddonName string - }{ - KubeClient: kubeClient, - Recorder: mEventRecorder, - AgentImage: agentImage, - AddonName: setup.MaintainAgentName}, - } - err = (&multiclusterv1alpha1.MirrorPeer{}).SetupWebhookWithManager(mgr) if err != nil { @@ -219,11 +205,6 @@ func (o *ManagerOptions) runManager() { logger.Error("Failed to add token exchange addon to addon manager", "error", err) } - err = addonMgr.AddAgent(&maintainenceModeAddon) - if err != nil { - logger.Error("Failed to add maintainence addon to addon manager", "error", err) - } - if err = (&DRPolicyReconciler{ HubClient: mgr.GetClient(), Scheme: mgr.GetScheme(),