From 1125e4c33d851674acf2ff3de0cca7abbf542c22 Mon Sep 17 00:00:00 2001 From: Jian Zhu Date: Mon, 15 Sep 2025 10:20:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1=20Remove=20resolved=20TODO=20comme?= =?UTF-8?q?nts=20(#1177)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ๐Ÿงน Remove resolved TODO comments - Remove TODO comment about confirming subject in CustomSignerConfigurations - Remove TODO comment about namespace value in manifestwork validating webhook ๐Ÿค– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Signed-off-by: zhujian * Ensure addon namespace and image pull secret sync - Remove outdated TODO comment about addon deployment in Hosted mode - Namespace creation is responsibility of addon developers - Image pull secrets are synced to namespaces with addon.open-cluster-management.io/namespace label by the AddonPullImageSecretController ๐Ÿค– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Signed-off-by: zhujian --------- Signed-off-by: zhujian Co-authored-by: Claude --- pkg/addon/templateagent/registration.go | 1 - .../klusterletcontroller/klusterlet_managed_reconcile.go | 1 - pkg/operator/operators/klusterlet/options.go | 2 +- pkg/work/webhook/v1/manifestwork_validating.go | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/addon/templateagent/registration.go b/pkg/addon/templateagent/registration.go index a0a09c7ba..251005681 100644 --- a/pkg/addon/templateagent/registration.go +++ b/pkg/addon/templateagent/registration.go @@ -157,7 +157,6 @@ func CustomSignerConfigurations(addonName, agentName string, } config := addonapiv1alpha1.RegistrationConfig{ SignerName: customSignerConfig.SignerName, - // TODO: confirm the subject Subject: addonapiv1alpha1.Subject{ User: agent.DefaultUser(cluster.Name, addonName, agentName), Groups: agent.DefaultGroups(cluster.Name, addonName), diff --git a/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_managed_reconcile.go b/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_managed_reconcile.go index 41efad713..e1cf7d80c 100644 --- a/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_managed_reconcile.go +++ b/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_managed_reconcile.go @@ -60,7 +60,6 @@ func (r *managedReconcile) reconcile(ctx context.Context, klusterlet *operatorap if !config.DisableAddonNamespace { // For now, whether in Default or Hosted mode, the addons will be deployed on the managed cluster. // sync image pull secret from management cluster to managed cluster for addon namespace - // TODO(zhujian7): In the future, we may consider deploy addons on the management cluster in Hosted mode. // Ensure the addon namespace on the managed cluster if err := ensureNamespace( ctx, diff --git a/pkg/operator/operators/klusterlet/options.go b/pkg/operator/operators/klusterlet/options.go index 2906e53d7..950d4a501 100644 --- a/pkg/operator/operators/klusterlet/options.go +++ b/pkg/operator/operators/klusterlet/options.go @@ -34,7 +34,7 @@ type Options struct { // RunKlusterletOperator starts a new klusterlet operator func (o *Options) RunKlusterletOperator(ctx context.Context, controllerContext *controllercmd.ControllerContext) error { - // Build kube client and informer for managed cluster + // Build kube client and informer kubeClient, err := kubernetes.NewForConfig(controllerContext.KubeConfig) if err != nil { return err diff --git a/pkg/work/webhook/v1/manifestwork_validating.go b/pkg/work/webhook/v1/manifestwork_validating.go index f97292a89..cf0b8c5d6 100644 --- a/pkg/work/webhook/v1/manifestwork_validating.go +++ b/pkg/work/webhook/v1/manifestwork_validating.go @@ -88,7 +88,7 @@ func validateExecutor(kubeClient kubernetes.Interface, work *workv1.ManifestWork Type: workv1.ExecutorSubjectTypeServiceAccount, ServiceAccount: &workv1.ManifestWorkSubjectServiceAccount{ // give the default value "system:serviceaccount::klusterlet-work-sa" - Namespace: "", // TODO: Not sure what value is reasonable + Namespace: "", Name: "klusterlet-work-sa", // the default sa of the work agent }, },