func (m *WatchManager) AddResourceWatcher(s ResourceWatcher) {
	m.resourceWatchers[s] = struct{}{}
	l := s.GetListener()
	if l == nil {
		panic("resource watcher should provide listener")
	}
	m.listeners = append(m.listeners, l)
}
AddResourceWatcher adds a resource watcher to the WatchManager.
package manager
import (
	"sync"
	schedulerconfig "sigs.k8s.io/cluster-api-provider-nested/virtualcluster/experiment/pkg/scheduler/apis/config"
	"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/util/listener"
	mc "sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/util/mccontroller"
	"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/util/reconciler"
)
type WatchManager struct {
	resourceWatchers map[ResourceWatcher]struct{}
	listeners        []listener.ClusterChangeListener
}
func New() *WatchManager {
	return &WatchManager{resourceWatchers: make(map[ResourceWatcher]struct{})}
}
type ResourceWatcher interface {
	reconciler.DWReconciler
	GetMCController() *mc.MultiClusterController
	GetListener() listener.ClusterChangeListener
	Start(stopCh <-chan struct{}) error
}
type ResourceWatcherNew func(*schedulerconfig.SchedulerConfiguration) (ResourceWatcher, error)