Documentation ¶
Index ¶
- func NewFakeTenantCluster(vc *v1alpha1.VirtualCluster, fakeClientSet clientset.Interface, ...) (*fakeCluster, error)
- type CacheOptions
- type Cluster
- func (c *Cluster) AddEventHandler(objectType runtime.Object, handler clientgocache.ResourceEventHandler) error
- func (c *Cluster) GetClientSet() (clientset.Interface, error)
- func (c *Cluster) GetClusterName() string
- func (c *Cluster) GetDelegatingClient() (client.Client, error)
- func (c *Cluster) GetInformer(objectType runtime.Object) (cache.Informer, error)
- func (c *Cluster) GetObject() (runtime.Object, error)
- func (c *Cluster) GetOwnerInfo() (string, string, string)
- func (c *Cluster) GetRestConfig() *rest.Config
- func (c *Cluster) SetKey(k string)
- func (c *Cluster) SetSynced()
- func (c *Cluster) Start() error
- func (c *Cluster) Stop()
- func (c *Cluster) WaitForCacheSync() bool
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeTenantCluster ¶
Types ¶
type CacheOptions ¶
type CacheOptions struct { // Resync is the period between cache resyncs. // A cache resync triggers event handlers for each object watched by the cache. // It can be useful if your level-based logic isn't perfect. Resync *time.Duration // WatchNamespace can be used to watch only a single namespace. // If unset (Namespace == ""), all namespaces are watched. WatchNamespace string }
CacheOptions is embedded in Options to configure the new Cluster's cache.
type Cluster ¶
type Cluster struct { // Config is the rest.config used to talk to the apiserver. Required. RestConfig *rest.Config // contains filtered or unexported fields }
Each Cluster object represents a tenant master in Virtual Cluster architecture.
Cluster implements the ClusterInterface used by MultiClusterController in sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/util/mccontroller/mccontroller.go.
It stores a Kubernetes client, cache, and other cluster-scoped dependencies. The dependencies are lazily created in getters and cached for reuse. It is not thread safe.
func NewCluster ¶
func (*Cluster) AddEventHandler ¶
func (c *Cluster) AddEventHandler(objectType runtime.Object, handler clientgocache.ResourceEventHandler) error
AddEventHandler instructs the Cluster's cache to watch objectType's resource, if it doesn't already, and to add handler as an event handler.
func (*Cluster) GetClientSet ¶
GetClientSet returns a clientset client without any informer caches. All client requests go to apiserver directly.
func (*Cluster) GetClusterName ¶
GetClusterName returns the unique cluster name, aka, the root namespace name.
func (*Cluster) GetDelegatingClient ¶
GetDelegatingClient returns a lazily created controller-runtime DelegatingClient. It is used by other Cluster getters, and by reconcilers. TODO: consider implementing Reader, Writer and StatusClient in Cluster and forwarding to actual delegating client.
func (*Cluster) GetInformer ¶
GetInformer fetches or constructs an informer for the given object that corresponds to a single API kind and resource.
func (*Cluster) GetRestConfig ¶
GetRestConfig returns restful configuration of virtual cluster client
func (*Cluster) Start ¶
Start starts the Cluster's cache and blocks, until an empty struct is sent to the stop channel.
func (*Cluster) WaitForCacheSync ¶
WaitForCacheSync waits for the Cluster's cache to sync, OR until an empty struct is sent to the stop channel.
type Options ¶
type Options struct { CacheOptions // RequestTimeout is the rest client request timeout. // Set this to something reasonable so request to apiserver don't hang forever. RequestTimeout time.Duration }
Options are the arguments for creating a new Cluster.