controllers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 YttSources.",
			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 YttSources.",
			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 YttSources.",
			e.Object.GetObjectKind()))
		return false
	}
)

Functions

func ConfigMapPredicates

func ConfigMapPredicates(logger logr.Logger) predicate.Funcs

ConfigMapPredicates predicates for ConfigMaps. YttSourceReconciler watches ConfigMap events and react to those by reconciling itself based on following predicates

func FluxSourcePredicates

func FluxSourcePredicates(s *runtime.Scheme, logger logr.Logger) predicate.Funcs

FluxSourcePredicates predicates for GitRepository/OCIRepository/Bucket. YttSourceReconciler watches GitRepository/OCIRepository/Bucket events and react to those by reconciling itself based on following predicates

func InitScheme

func InitScheme() (*runtime.Scheme, error)

func SecretPredicates

func SecretPredicates(logger logr.Logger) predicate.Funcs

SecretPredicates predicates for Secrets. YttSourceReconciler watches Secret events and react to those by reconciling itself based on following predicates

Types

type YttSourceReconciler

type YttSourceReconciler struct {
	client.Client
	Scheme *runtime.Scheme

	ConcurrentReconciles int
	PolicyMux            sync.Mutex                                    // use a Mutex to update Map as MaxConcurrentReconciles is higher than one
	ReferenceMap         map[corev1.ObjectReference]*libsveltosset.Set // key: Referenced object; value: set of all YTTSources referencing the resource
	YttSourceMap         map[types.NamespacedName]*libsveltosset.Set   // key: YTTSource namespace/name; value: set of referenced resources
}

YttSourceReconciler reconciles a YttSource object

func (*YttSourceReconciler) Close

func (s *YttSourceReconciler) Close(ctx context.Context, yttSource *extensionv1alpha1.YttSource,
	patchHelper *patch.Helper) error

Close closes the current scope persisting the YttSource status.

func (*YttSourceReconciler) Reconcile

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

func (*YttSourceReconciler) SetupWithManager

func (r *YttSourceReconciler) SetupWithManager(mgr ctrl.Manager,
) (controller.Controller, error)

SetupWithManager sets up the controller with the Manager.

func (*YttSourceReconciler) WatchForFlux

func (r *YttSourceReconciler) WatchForFlux(mgr ctrl.Manager, c controller.Controller) error

Jump to

Keyboard shortcuts

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