Documentation ¶
Overview ¶
Package reflection implements the reflection logic of custom resources between a local cluster to a remote one.
Index ¶
- func IsReplicated(obj metav1.Object) bool
- func LocalResourcesLabelSelector() metav1.LabelSelector
- func ReplicatedResourcesLabelSelector() metav1.LabelSelector
- type Manager
- type Reflector
- func (r *Reflector) ResourceStarted(resource *resources.Resource) bool
- func (r *Reflector) Start(ctx context.Context)
- func (r *Reflector) StartForResource(ctx context.Context, resource *resources.Resource)
- func (r *Reflector) Stop() error
- func (r *Reflector) StopForResource(resource *resources.Resource) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsReplicated ¶
IsReplicated returns whether the given object is replicated by the CRD replicator.
func LocalResourcesLabelSelector ¶
func LocalResourcesLabelSelector() metav1.LabelSelector
LocalResourcesLabelSelector is an helper function which returns a label selector to list all the local resources to be replicated.
func ReplicatedResourcesLabelSelector ¶
func ReplicatedResourcesLabelSelector() metav1.LabelSelector
ReplicatedResourcesLabelSelector is an helper function which returns a label selector to list all the replicated resources.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager represents an object creating reflectors towards remote clusters.
func NewManager ¶
func NewManager(client dynamic.Interface, clusterID liqov1beta1.ClusterID, workersPerCluster uint, resync time.Duration) *Manager
NewManager returns a new manager to start the reflection towards remote clusters.
func (*Manager) NewForRemote ¶
func (m *Manager) NewForRemote(client dynamic.Interface, clusterID liqov1beta1.ClusterID, localNamespace, remoteNamespace string) *Reflector
NewForRemote returns a new reflector for a given remote cluster.
type Reflector ¶
type Reflector struct {
// contains filtered or unexported fields
}
Reflector represents an object managing the reflection of resources towards a given remote cluster.
func (*Reflector) ResourceStarted ¶
ResourceStarted returns whether the reflection for the given resource has been started.
func (*Reflector) StartForResource ¶
StartForResource starts the reflection of the given resource. It panics if executed for a resource with the reflection already started.