diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index 5558de9ff..54dd9c753 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -291,7 +291,7 @@ func (c completedConfig) New(ctx context.Context) (*UIServer, error) { os.Exit(1) } - err = clustermetacontroller.NewReconciler(mgr.GetClient(), bc).SetupWithManager(mgr) + err = clustermetacontroller.NewReconciler(mgr.GetClient(), bc, cid).SetupWithManager(mgr) if err != nil { klog.Error(err, "unable to create controller", "controller", "ConfigMap") os.Exit(1) diff --git a/pkg/controllers/clustermetadata/cm_controller.go b/pkg/controllers/clustermetadata/cm_controller.go index 5e96d5101..352a077e7 100644 --- a/pkg/controllers/clustermetadata/cm_controller.go +++ b/pkg/controllers/clustermetadata/cm_controller.go @@ -41,10 +41,11 @@ type ClusterMetadataReconciler struct { var _ reconcile.Reconciler = &ClusterMetadataReconciler{} -func NewReconciler(kc client.Client, bc *identitylib.Client) *ClusterMetadataReconciler { +func NewReconciler(kc client.Client, bc *identitylib.Client, clusterId string) *ClusterMetadataReconciler { return &ClusterMetadataReconciler{ - kc: kc, - bc: bc, + kc: kc, + bc: bc, + clusterID: clusterId, } }