Documentation ¶
Index ¶
- Constants
- Variables
- func ClusterSetPredicates(logger logr.Logger) predicate.Funcs
- func ConfigMapPredicates(logger logr.Logger) predicate.Funcs
- func EventReportPredicates(logger logr.Logger) predicate.Funcs
- func EventSourcePredicates(logger logr.Logger) predicate.Funcs
- func InitScheme() (*runtime.Scheme, error)
- func RegisterFeatures(d deployer.DeployerInterface, setupLog logr.Logger)
- func SecretPredicates(logger logr.Logger) predicate.Funcs
- func SetVersion(v string)
- func SveltosClusterPredicates(logger logr.Logger) predicate.Funcs
- type ClusterPredicate
- func (p ClusterPredicate) Create(obj event.TypedCreateEvent[*clusterv1.Cluster]) bool
- func (p ClusterPredicate) Delete(obj event.TypedDeleteEvent[*clusterv1.Cluster]) bool
- func (p ClusterPredicate) Generic(obj event.TypedGenericEvent[*clusterv1.Cluster]) bool
- func (p ClusterPredicate) Update(obj event.TypedUpdateEvent[*clusterv1.Cluster]) bool
- type ClusterReconciler
- type EventSourceReconciler
- type EventTriggerReconciler
- func (r *EventTriggerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
- func (r *EventTriggerReconciler) SetupWithManager(mgr ctrl.Manager) (controller.Controller, error)
- func (r *EventTriggerReconciler) WatchForCAPI(mgr ctrl.Manager, c controller.Controller) error
- type MachinePredicate
- func (p MachinePredicate) Create(obj event.TypedCreateEvent[*clusterv1.Machine]) bool
- func (p MachinePredicate) Delete(obj event.TypedDeleteEvent[*clusterv1.Machine]) bool
- func (p MachinePredicate) Generic(obj event.TypedGenericEvent[*clusterv1.Machine]) bool
- func (p MachinePredicate) Update(obj event.TypedUpdateEvent[*clusterv1.Machine]) bool
- type ReportMode
- type SveltosClusterReconciler
Constants ¶
const (
// Namespace where reports will be generated
ReportNamespace = "projectsveltos"
)
Variables ¶
var ( CreateFuncTrue = func(e event.CreateEvent, logger logr.Logger) bool { log := logger.WithValues("predicate", "createEvent", e.Object.GetObjectKind(), e.Object.GetName(), ) log.V(logs.LogVerbose).Info(fmt.Sprintf( "%s did match expected conditions. Will attempt to reconcile associated EvenTriggers.", e.Object.GetObjectKind())) return true } DeleteFuncTrue = func(e event.DeleteEvent, logger logr.Logger) bool { log := logger.WithValues("predicate", "deleteEvent", e.Object.GetObjectKind(), e.Object.GetName(), ) log.V(logs.LogVerbose).Info(fmt.Sprintf( "%s did match expected conditions. Will attempt to reconcile associated EvenTriggers.", e.Object.GetObjectKind())) return true } GenericFuncFalse = func(e event.GenericEvent, logger logr.Logger) bool { log := logger.WithValues("predicate", "genericEvent", e.Object.GetObjectKind(), e.Object.GetName(), ) log.V(logs.LogVerbose).Info(fmt.Sprintf( "%s did not match expected conditions. Will not attempt to reconcile associated EvenTriggers.", e.Object.GetObjectKind())) return false } )
Functions ¶
func ClusterSetPredicates ¶ added in v0.27.0
ClusterSetPredicates predicates for ClusterSet. EventTriggerReconciler watches ClusterSet events and react to those by reconciling itself based on following predicates
func ConfigMapPredicates ¶ added in v0.7.2
ConfigMapPredicates predicates for ConfigMaps. ClusterSummaryReconciler watches ConfigMap events and react to those by reconciling itself based on following predicates
func EventReportPredicates ¶
EventReportPredicates predicates for EventReport. EventTriggerReconciler watches sveltos EventReport events and react to those by reconciling itself based on following predicates
func EventSourcePredicates ¶
EventSourcePredicates predicates for EventSource. EventTriggerReconciler watches sveltos EventSource and react to those by reconciling itself based on following predicates
func InitScheme ¶
func RegisterFeatures ¶
func RegisterFeatures(d deployer.DeployerInterface, setupLog logr.Logger)
func SecretPredicates ¶ added in v0.7.2
SecretPredicates predicates for Secrets. ClusterSummaryReconciler watches Secret events and react to those by reconciling itself based on following predicates
func SetVersion ¶ added in v0.38.0
func SetVersion(v string)
Types ¶
type ClusterPredicate ¶ added in v0.29.0
func (ClusterPredicate) Create ¶ added in v0.29.0
func (p ClusterPredicate) Create(obj event.TypedCreateEvent[*clusterv1.Cluster]) bool
func (ClusterPredicate) Delete ¶ added in v0.29.0
func (p ClusterPredicate) Delete(obj event.TypedDeleteEvent[*clusterv1.Cluster]) bool
func (ClusterPredicate) Generic ¶ added in v0.29.0
func (p ClusterPredicate) Generic(obj event.TypedGenericEvent[*clusterv1.Cluster]) bool
func (ClusterPredicate) Update ¶ added in v0.29.0
func (p ClusterPredicate) Update(obj event.TypedUpdateEvent[*clusterv1.Cluster]) bool
type ClusterReconciler ¶
ClusterReconciler reconciles a Cluster object
func (*ClusterReconciler) SetupWithManager ¶
func (r *ClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type EventSourceReconciler ¶
EventSourceReconciler reconciles a EventSource object
func (*EventSourceReconciler) Reconcile ¶
func (r *EventSourceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
+kubebuilder:rbac:groups=lib.projectsveltos.io,resources=eventsources,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=lib.projectsveltos.io,resources=eventsources/status,verbs=get;update;patch +kubebuilder:rbac:groups=lib.projectsveltos.io,resources=eventsources/finalizers,verbs=update
func (*EventSourceReconciler) SetupWithManager ¶
func (r *EventSourceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type EventTriggerReconciler ¶ added in v0.21.0
type EventTriggerReconciler struct { client.Client Scheme *runtime.Scheme ConcurrentReconciles int Deployer deployer.DeployerInterface EventReportMode ReportMode ShardKey string Logger logr.Logger // use a Mutex to update Map as MaxConcurrentReconciles is higher than one Mux sync.Mutex // key: Sveltos/CAPI Cluster: value: set of all EventTrigger instances matching the Cluster ClusterMap map[corev1.ObjectReference]*libsveltosset.Set // key: EventTrigger: value: set of Sveltos/CAPI Clusters matched ToClusterMap map[types.NamespacedName]*libsveltosset.Set // key: EventTriggers; value EventTrigger Selector EventTriggers map[corev1.ObjectReference]libsveltosv1beta1.Selector // For each cluster contains current labels // This is needed in following scenario: // - EventTrigger is created // - Cluster is created with labels matching EventTrigger // - When first control plane machine in such cluster becomes available // we need Cluster labels to know which EventTrigger to reconcile ClusterLabels map[corev1.ObjectReference]map[string]string // key: ClusterSet: value ClusterProfiles currently referencing the ClusterSet ClusterSetMap map[corev1.ObjectReference]*libsveltosset.Set // key: EventSource: value: set of all EventTrigger referencing it EventSourceMap map[corev1.ObjectReference]*libsveltosset.Set // Key: EventTrigger: value: set of EventSource referenced ToEventSourceMap map[types.NamespacedName]*libsveltosset.Set }
EventTriggerReconciler reconciles a EventTrigger object
func (*EventTriggerReconciler) SetupWithManager ¶ added in v0.21.0
func (r *EventTriggerReconciler) SetupWithManager(mgr ctrl.Manager) (controller.Controller, error)
SetupWithManager sets up the controller with the Manager.
func (*EventTriggerReconciler) WatchForCAPI ¶ added in v0.21.0
func (r *EventTriggerReconciler) WatchForCAPI(mgr ctrl.Manager, c controller.Controller) error
type MachinePredicate ¶ added in v0.29.0
func (MachinePredicate) Create ¶ added in v0.29.0
func (p MachinePredicate) Create(obj event.TypedCreateEvent[*clusterv1.Machine]) bool
func (MachinePredicate) Delete ¶ added in v0.29.0
func (p MachinePredicate) Delete(obj event.TypedDeleteEvent[*clusterv1.Machine]) bool
func (MachinePredicate) Generic ¶ added in v0.29.0
func (p MachinePredicate) Generic(obj event.TypedGenericEvent[*clusterv1.Machine]) bool
func (MachinePredicate) Update ¶ added in v0.29.0
func (p MachinePredicate) Update(obj event.TypedUpdateEvent[*clusterv1.Machine]) bool
type ReportMode ¶
type ReportMode int
const ( // Default mode. In this mode, eventManager running // in the management cluster periodically collects // EventReports from Sveltos/CAPI clusters CollectFromManagementCluster ReportMode = iota // In this mode, sveltos agent sends EventReport // to management cluster. // SveltosAgent is provided with Kubeconfig to access // management cluster and can only update EventReport // (and ClassifierReport and HealthCheckReport). AgentSendReportsNoGateway )
type SveltosClusterReconciler ¶
SveltosClusterReconciler reconciles a SveltosCluster object
func (*SveltosClusterReconciler) SetupWithManager ¶
func (r *SveltosClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.