func (c *Cluster) GetClusterName() string {
	return c.key
}
GetClusterName returns the unique cluster name, aka, the root namespace name.
package cluster
import (
	"context"
	"fmt"
	"time"
	"k8s.io/apimachinery/pkg/api/meta"
	"k8s.io/apimachinery/pkg/runtime"
	clientset "k8s.io/client-go/kubernetes"
	"k8s.io/client-go/kubernetes/scheme"
	"k8s.io/client-go/rest"
	restclient "k8s.io/client-go/rest"
	clientgocache "k8s.io/client-go/tools/cache"
	"k8s.io/client-go/tools/clientcmd"
	"k8s.io/klog"
	"sigs.k8s.io/controller-runtime/pkg/cache"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
	"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/util/constants"
	"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/util/mccontroller"
)
type Cluster struct {
	key string
	name string
	namespace string
	uid string
	RestConfig *rest.Config
	getter mccontroller.Getter
	scheme *runtime.Scheme
	mapper meta.RESTMapper
	cache            cache.Cache
	delegatingClient client.Client
	client *clientset.Clientset
	options Options
	synced bool
	cancelContext context.CancelFunc
	context context.Context
}
type Options struct {
	CacheOptions
	RequestTimeout time.Duration
}
type CacheOptions struct {
	Resync *time.Duration
	WatchNamespace string
}
var _ mccontroller.ClusterInterface = &Cluster{}
func NewCluster(key, namespace, name, uid string, getter mccontroller.Getter, configBytes []byte, o Options) (*Cluster, error) {
	clusterRestConfig, err := clientcmd.RESTConfigFromKubeConfig(configBytes)
	if err != nil {
		return nil, fmt.Errorf("failed to build rest config: %v", err)
	}
	if o.RequestTimeout == 0 {
		clusterRestConfig.Timeout = constants.DefaultRequestTimeout
	}
	if clusterRestConfig.QPS == 0 {
		clusterRestConfig.QPS = constants.DefaultSyncerClientQPS
	}
	if clusterRestConfig.Burst == 0 {
		clusterRestConfig.Burst = constants.DefaultSyncerClientBurst
	}
	return &Cluster{
		key:        key,
		name:       name,
		namespace:  namespace,
		uid:        uid,
		getter:     getter,
		RestConfig: clusterRestConfig,
		options:    o,
		synced:     false,
		context:    context.Background(),
	}, nil
}