controllers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 43 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 JsonnetSources.",
			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 JsonnetSources.",
			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 JsonnetSources.",
			e.Object.GetObjectKind()))
		return false
	}
)

Functions

func ConfigMapPredicates

func ConfigMapPredicates(logger logr.Logger) predicate.Funcs

ConfigMapPredicates predicates for ConfigMaps. ClusterSummaryReconciler watches ConfigMap 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. ClusterSummaryReconciler watches Secret events and react to those by reconciling itself based on following predicates

Types

type FluxBucketPredicate added in v0.3.0

type FluxBucketPredicate struct {
	Logger logr.Logger
}

func (FluxBucketPredicate) Create added in v0.3.0

func (FluxBucketPredicate) Delete added in v0.3.0

func (FluxBucketPredicate) Generic added in v0.3.0

func (FluxBucketPredicate) Update added in v0.3.0

type FluxGitRepositoryPredicate added in v0.3.0

type FluxGitRepositoryPredicate struct {
	Logger logr.Logger
}

func (FluxGitRepositoryPredicate) Create added in v0.3.0

func (FluxGitRepositoryPredicate) Delete added in v0.3.0

func (FluxGitRepositoryPredicate) Generic added in v0.3.0

func (FluxGitRepositoryPredicate) Update added in v0.3.0

type FluxOCIRepositoryPredicate added in v0.3.0

type FluxOCIRepositoryPredicate struct {
	Logger logr.Logger
}

func (FluxOCIRepositoryPredicate) Create added in v0.3.0

func (FluxOCIRepositoryPredicate) Delete added in v0.3.0

func (FluxOCIRepositoryPredicate) Generic added in v0.3.0

func (FluxOCIRepositoryPredicate) Update added in v0.3.0

type JsonnetSourceReconciler

type JsonnetSourceReconciler 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 JsonnetSources referencing the resource
	JsonnetSourceMap     map[types.NamespacedName]*libsveltosset.Set   // key: JsonnetSource namespace/name; value: set of referenced resources
}

JsonnetSourceReconciler reconciles a JsonnetSource object

func (*JsonnetSourceReconciler) Close

func (s *JsonnetSourceReconciler) Close(ctx context.Context, jsonnetSource *extensionv1beta1.JsonnetSource,
	patchHelper *patch.Helper) error

Close closes the current scope persisting the JsonnetSource status.

func (*JsonnetSourceReconciler) Reconcile

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

func (*JsonnetSourceReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*JsonnetSourceReconciler) WatchForFlux

Jump to

Keyboard shortcuts

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