Documentation
¶
Index ¶
- func PhysicalClusterNamespaceName(l NamespaceLocator) (string, error)
- func StartSyncer(ctx context.Context, cfg *SyncerConfig, numSyncerThreads int, ...) error
- type APIImporter
- type Controller
- type DeleteFunc
- type HandlersProvider
- type NamespaceLocator
- type SyncDirection
- type SyncerConfig
- type UpsertFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PhysicalClusterNamespaceName ¶
func PhysicalClusterNamespaceName(l NamespaceLocator) (string, error)
PhysicalClusterNamespaceName encodes the NamespaceLocator to a new namespace name for use on a physical cluster. The encoding is repeatable.
func StartSyncer ¶
Types ¶
type APIImporter ¶ added in v0.6.0
type APIImporter struct {
SyncedGVRs map[string]metav1.GroupVersionResource
// contains filtered or unexported fields
}
func NewAPIImporter ¶ added in v0.6.0
func NewAPIImporter( upstreamConfig, downstreamConfig *rest.Config, resourcesToSync []string, logicalClusterName logicalcluster.LogicalCluster, location string, ) (*APIImporter, error)
func (*APIImporter) ImportAPIs ¶ added in v0.6.0
func (i *APIImporter) ImportAPIs(ctx context.Context)
func (*APIImporter) Start ¶ added in v0.6.0
func (i *APIImporter) Start(ctx context.Context, pollInterval time.Duration)
func (*APIImporter) Stop ¶ added in v0.6.0
func (i *APIImporter) Stop()
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func New ¶
func New(kcpClusterName logicalcluster.LogicalCluster, pcluster string, fromClient, toClient dynamic.Interface, direction SyncDirection, gvrs []string, pclusterID string, mutators mutatorGvrMap) (*Controller, error)
New returns a new syncer Controller syncing spec from "from" to "to".
func NewSpecSyncer ¶
func NewSpecSyncer(from, to *rest.Config, gvrs []string, kcpClusterName logicalcluster.LogicalCluster, pclusterID string) (*Controller, error)
func NewStatusSyncer ¶
func NewStatusSyncer(from, to *rest.Config, gvrs []string, kcpClusterName logicalcluster.LogicalCluster, pclusterID string) (*Controller, error)
func (*Controller) AddToQueue ¶
func (c *Controller) AddToQueue(gvr schema.GroupVersionResource, obj interface{})
type DeleteFunc ¶
type HandlersProvider ¶
type HandlersProvider func(c *Controller, gvr schema.GroupVersionResource) cache.ResourceEventHandlerFuncs
type NamespaceLocator ¶
type NamespaceLocator struct {
LogicalCluster logicalcluster.LogicalCluster `json:"logical-cluster"`
Namespace string `json:"namespace"`
}
NamespaceLocator stores a logical cluster and namespace and is used as the source for the mapped namespace name in a physical cluster.
func LocatorFromAnnotations ¶
func LocatorFromAnnotations(annotations map[string]string) (*NamespaceLocator, error)
type SyncDirection ¶
type SyncDirection string
SyncDirection indicates which direction data is flowing for this particular syncer
const SyncDown SyncDirection = "down"
SyncDown indicates a syncer watches resources on KCP and applies the spec to the target cluster
const SyncUp SyncDirection = "up"
SyncUp indicates a syncer watches resources on the target cluster and applies the status to KCP
type SyncerConfig ¶ added in v0.6.0
type SyncerConfig struct {
UpstreamConfig *rest.Config
DownstreamConfig *rest.Config
ResourcesToSync sets.String
KCPClusterName logicalcluster.LogicalCluster
WorkloadClusterName string
}
SyncerConfig defines the syncer configuration that is guaranteed to vary across syncer deployments. Capturing these details in a struct simplifies defining these details in test fixture.
func (*SyncerConfig) ID ¶
func (sc *SyncerConfig) ID() string
type UpsertFunc ¶
type UpsertFunc func(ctx context.Context, gvr schema.GroupVersionResource, namespace string, unstrob *unstructured.Unstructured) error