func NewConfigMapReconciler(mgr manager.Manager, clusterConfig cluster.Config, watchNamespace string) (*ConfigMapReconciler, error) {
	clientset, err := kubernetes.NewForConfig(mgr.GetConfig())
	if err != nil {
		return nil, errors.Wrap(err, "error creating kubernetes clientset")
	}

	// Initialize prometheus configuration
	pc, err := metrics.NewPrometheusNodeConfig(clientset, watchNamespace)
	if err != nil {
		return nil, errors.Wrap(err, "unable to initialize Prometheus configuration")
	}
	return &ConfigMapReconciler{
		instanceReconciler: instanceReconciler{
			client:               mgr.GetClient(),
			k8sclientset:         clientset,
			clusterServiceCIDR:   clusterConfig.Network().GetServiceCIDR(),
			log:                  ctrl.Log.WithName("controllers").WithName("ConfigMap"),
			watchNamespace:       watchNamespace,
			recorder:             mgr.GetEventRecorderFor("configmap"),
			vxlanPort:            clusterConfig.Network().VXLANPort(),
			prometheusNodeConfig: pc,
		},
	}, nil
}
// NewConfigMapReconciler returns a pointer to a ConfigMapReconciler
NewConfigMapReconciler returns a pointer to a ConfigMapReconciler
// NewConfigMapReconciler returns a pointer to a ConfigMapReconciler
func NewConfigMapReconciler(mgr manager.Manager, clusterConfig cluster.Config, watchNamespace string) (*ConfigMapReconciler, error) {
	clientset, err := kubernetes.NewForConfig(mgr.GetConfig())
	if err != nil {
		return nil, errors.Wrap(err, "error creating kubernetes clientset")
	}
	pc, err := metrics.NewPrometheusNodeConfig(clientset, watchNamespace)
	if err != nil {
		return nil, errors.Wrap(err, "unable to initialize Prometheus configuration")
	}
	return &ConfigMapReconciler{
		instanceReconciler: instanceReconciler{
			client:               mgr.GetClient(),
			k8sclientset:         clientset,
			clusterServiceCIDR:   clusterConfig.Network().GetServiceCIDR(),
			log:                  ctrl.Log.WithName("controllers").WithName("ConfigMap"),
			watchNamespace:       watchNamespace,
			recorder:             mgr.GetEventRecorderFor("configmap"),
			vxlanPort:            clusterConfig.Network().VXLANPort(),
			prometheusNodeConfig: pc,
		},
	}, nil
}
func NewConfigMapReconciler ( mgr manager . Manager , clusterConfig cluster . Config , watchNamespace string ) ( * ConfigMapReconciler , error ) { clientset , err := kubernetes . NewForConfig ( mgr . GetConfig ( ) ) if err != nil { return nil , errors . Wrap ( err , " " ) } pc , err := metrics . NewPrometheusNodeConfig ( clientset , watchNamespace ) if err != nil { return nil , errors . Wrap ( err , " " ) } return & ConfigMapReconciler { instanceReconciler : instanceReconciler { client : mgr . GetClient ( ) , k8sclientset : clientset , clusterServiceCIDR : clusterConfig . Network ( ) . GetServiceCIDR ( ) , log : ctrl . Log . WithName ( " " ) . WithName ( " " ) , watchNamespace : watchNamespace , recorder : mgr . GetEventRecorderFor ( " " ) , vxlanPort : clusterConfig . Network ( ) . VXLANPort ( ) , prometheusNodeConfig : pc , } , } , nil }
NewConfigMapReconciler returns a pointer to a ConfigMapReconciler
NewConfigMapReconciler returns a pointer to a ConfigMapReconciler
// Initialize prometheus configuration