controllers

package
v0.2.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoreResourcesSourceFeatureName = "cluster-registry-core-resources-source"
	CoreResourceLabelName          = "cluster-registry-controller.k8s.cisco.com/core-sync-resource"
)

Variables

View Source
var (
	ErrInvalidClusterID     = errors.New("invalid cluster ID")
	ErrInvalidSecretContent = errors.New("could not found k8s config in secret")
	ErrInvalidSecret        = errors.New("invalid secret type")
	ErrLocalClusterConflict = errors.New("multiple local clusters are defined")
)

Functions

func GetClusterID

func GetClusterID(ctx context.Context, c client.Client) (types.UID, error)

func InitNewResourceSyncController

func InitNewResourceSyncController(rule *clusterregistryv1alpha1.ResourceSyncRule, cluster *clusters.Cluster, clustersManager *clusters.Manager, mgr ctrl.Manager, log logr.Logger, config config.Configuration) (clusters.ManagedController, error)

func LocalClusterCondition

func LocalClusterCondition(isClusterLocal bool) clusterregistryv1alpha1.ClusterCondition

func LocalClusterConflictCondition

func LocalClusterConflictCondition(conflict bool) clusterregistryv1alpha1.ClusterCondition

func SetCondition

func SetCondition(cluster *clusterregistryv1alpha1.Cluster, currentConditions ClusterConditionsMap, condition clusterregistryv1alpha1.ClusterCondition, recorder record.EventRecorder)

func UpdateCluster

func UpdateCluster(ctx context.Context, reconcileError error, c client.Client, cluster *clusterregistryv1alpha1.Cluster, currentConditions ClusterConditionsMap, log logr.Logger) error

func UpdateClusterStatus

func UpdateClusterStatus(ctx context.Context, c client.Client, cluster *clusterregistryv1alpha1.Cluster, log logr.Logger) error

func WrapAsPermanentError

func WrapAsPermanentError(err error) error

Types

type ClusterFeatureReconciler

type ClusterFeatureReconciler struct {
	clusters.ManagedReconciler
	// contains filtered or unexported fields
}

func NewClusterFeatureReconciler

func NewClusterFeatureReconciler(name string, cluster *clusters.Cluster, log logr.Logger) *ClusterFeatureReconciler

func (*ClusterFeatureReconciler) Reconcile

func (*ClusterFeatureReconciler) SetupWithController

func (r *ClusterFeatureReconciler) SetupWithController(ctx context.Context, ctrl controller.Controller) error

type ClusterReconciler

type ClusterReconciler struct {
	clusters.ManagedReconciler
	// contains filtered or unexported fields
}

func NewClusterReconciler

func NewClusterReconciler(name string, log logr.Logger, clustersManager *clusters.Manager, config config.Configuration) *ClusterReconciler

func (*ClusterReconciler) Reconcile

func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*ClusterReconciler) SetupWithController

func (r *ClusterReconciler) SetupWithController(ctx context.Context, ctrl controller.Controller) error

func (*ClusterReconciler) SetupWithManager

func (r *ClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

type Frame

type Frame = errors.Frame

type InMemorySource

type InMemorySource struct {
	// contains filtered or unexported fields
}

func (*InMemorySource) String

func (s *InMemorySource) String() string

type QueueAwareReconciler

type QueueAwareReconciler interface {
	// contains filtered or unexported methods
}

type RemoteClusterReconciler

type RemoteClusterReconciler struct {
	clusters.ManagedReconciler
	// contains filtered or unexported fields
}

func NewRemoteClusterReconciler

func NewRemoteClusterReconciler(name string, localMgr ctrl.Manager, log logr.Logger) *RemoteClusterReconciler

func (*RemoteClusterReconciler) Reconcile

func (r *RemoteClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*RemoteClusterReconciler) SetupWithController

func (r *RemoteClusterReconciler) SetupWithController(ctx context.Context, ctrl controller.Controller) error

type ResourceSyncRuleReconciler

type ResourceSyncRuleReconciler struct {
	clusters.ManagedReconciler
	// contains filtered or unexported fields
}

func NewResourceSyncRuleReconciler

func NewResourceSyncRuleReconciler(name string, log logr.Logger, clustersManager *clusters.Manager, config config.Configuration) *ResourceSyncRuleReconciler

func (*ResourceSyncRuleReconciler) Reconcile

func (*ResourceSyncRuleReconciler) SetupWithController

func (r *ResourceSyncRuleReconciler) SetupWithController(ctx context.Context, ctrl controller.Controller) error

func (*ResourceSyncRuleReconciler) SetupWithManager

func (r *ResourceSyncRuleReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

type StackTrace

type StackTrace = errors.StackTrace

type SyncReconciler

type SyncReconciler interface {
	clusters.ManagedReconciler

	GetRule() *clusterregistryv1alpha1.ResourceSyncRule
}

func NewSyncReconciler

func NewSyncReconciler(name string, localMgr ctrl.Manager, rule *clusterregistryv1alpha1.ResourceSyncRule, log logr.Logger, clusterID string, clustersManager *clusters.Manager, opts ...SyncReconcilerOption) (SyncReconciler, error)

type SyncReconcilerOption

type SyncReconcilerOption func(r *syncReconciler)

func WithRateLimiter

func WithRateLimiter(rateLimiter throttled.RateLimiter) SyncReconcilerOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL