Documentation ¶
Index ¶
- Variables
- func ClusterPredicates(logger logr.Logger) predicate.Funcs
- func ConfigMapPredicates(logger logr.Logger) predicate.Funcs
- func FluxSourcePredicates(s *runtime.Scheme, logger logr.Logger) predicate.Funcs
- func GetManager() *manager
- func InitScheme() (*runtime.Scheme, error)
- func MachinePredicates(logger logr.Logger) predicate.Funcs
- func SecretPredicates(logger logr.Logger) predicate.Funcs
- func SveltosClusterPredicates(logger logr.Logger) predicate.Funcs
- type AddonComplianceReconciler
- func (r *AddonComplianceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
- func (r *AddonComplianceReconciler) SetupWithManager(mgr ctrl.Manager) (controller.Controller, error)
- func (r *AddonComplianceReconciler) WatchForCAPI(mgr ctrl.Manager, c controller.Controller) error
- func (r *AddonComplianceReconciler) WatchForFlux(mgr ctrl.Manager, c controller.Controller) error
- type ClusterReconciler
- type SveltosClusterReconciler
Constants ¶
This section is empty.
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 AddonCompliances.", 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 AddonCompliances.", 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 AddonCompliances.", e.Object.GetObjectKind())) return false } )
Functions ¶
func ClusterPredicates ¶
ClusterPredicates predicates for v1Cluster. AddonComplianceReconciler watches v1Cluster events and react to those by reconciling itself based on following predicates
func ConfigMapPredicates ¶
ConfigMapPredicates predicates for ConfigMaps. AddonComplianceReconciler watches ConfigMap events and react to those by reconciling itself based on following predicates
func FluxSourcePredicates ¶
FluxSourcePredicates predicates for GitRepository/OCIRepository/Bucket. AddonComplianceReconciler watches GitRepository/OCIRepository/Bucket events and react to those by reconciling itself based on following predicates
func GetManager ¶
func GetManager() *manager
GetManager returns the manager instance implementing the ClassifierInterface. Returns nil if manager has not been initialized yet
func InitScheme ¶
func MachinePredicates ¶
MachinePredicates predicates for v1Machine. AddonComplianceReconciler watches v1Machine events and react to those by reconciling itself based on following predicates
func SecretPredicates ¶
SecretPredicates predicates for Secrets. AddonComplianceReconciler watches Secret events and react to those by reconciling itself based on following predicates
Types ¶
type AddonComplianceReconciler ¶
type AddonComplianceReconciler struct { client.Client Scheme *runtime.Scheme ConcurrentReconciles int // use a Mutex to update Map as MaxConcurrentReconciles is higher than one PolicyMux sync.Mutex // For each cluster contains current labels // This is needed in following scenario: // - AddonCompliance is created // - Cluster is created with labels matching AddonCompliance // - When first control plane machine in such cluster becomes available // we need Cluster labels to know which AddonCompliance to reconcile ClusterLabels map[corev1.ObjectReference]map[string]string // key: AddonCompliance; value AddonCompliance Selector AddonCompliances map[types.NamespacedName]libsveltosv1alpha1.Selector // key: Sveltos/CAPI Cluster; value: set of all AddonCompliances matching the Cluster ClusterMap map[corev1.ObjectReference]*libsveltosset.Set // key: AddonCompliance; value: set of Sveltos/CAPI Clusters matched AddonComplianceToClusterMap map[types.NamespacedName]*libsveltosset.Set // key: Referenced object; value: set of all AddonCompliances referencing the resource ReferenceMap map[corev1.ObjectReference]*libsveltosset.Set // key: AddonCompliance name; value: set of referenced resources AddonComplianceToReferenceMap map[types.NamespacedName]*libsveltosset.Set }
AddonComplianceReconciler reconciles a AddonCompliance object
func (*AddonComplianceReconciler) SetupWithManager ¶
func (r *AddonComplianceReconciler) SetupWithManager(mgr ctrl.Manager) (controller.Controller, error)
SetupWithManager sets up the controller with the Manager.
func (*AddonComplianceReconciler) WatchForCAPI ¶
func (r *AddonComplianceReconciler) WatchForCAPI(mgr ctrl.Manager, c controller.Controller) error
func (*AddonComplianceReconciler) WatchForFlux ¶
func (r *AddonComplianceReconciler) WatchForFlux(mgr ctrl.Manager, c controller.Controller) error
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 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.