controllers

package
v0.0.0-...-52c84f1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: v1alpha1.GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func TemplateRateLimiter

func TemplateRateLimiter(failureBaseDelay time.Duration, failureMaxDelay time.Duration,
	frequency int, burst int,
) ratelimiter.RateLimiter

TemplateRateLimiter implements a rate limiter for a client-go.workqueue. It has both an overall (token bucket) and per-item (exponential) rate limiting.

Types

type ManifestResources

type ManifestResources struct {
	Items []*unstructured.Unstructured
	Blobs [][]byte
}

type RateLimiter

type RateLimiter struct {
	Burst           int
	Frequency       int
	BaseDelay       time.Duration
	FailureMaxDelay time.Duration
}

type SampleReconciler

type SampleReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	*rest.Config
	// EventRecorder for creating k8s events
	record.EventRecorder
	FinalState         v1alpha1.State
	FinalDeletionState v1alpha1.State
}

SampleReconciler reconciles a Sample object.

func (*SampleReconciler) HandleDeletingState

func (r *SampleReconciler) HandleDeletingState(ctx context.Context, objectInstance *v1alpha1.Sample) error

HandleDeletingState processed the deletion on the reconciled resource. Once the deletion if processed the relevant finalizers (if applied) are removed.

func (*SampleReconciler) HandleErrorState

func (r *SampleReconciler) HandleErrorState(ctx context.Context, objectInstance *v1alpha1.Sample) error

HandleErrorState handles error recovery for the reconciled resource.

func (*SampleReconciler) HandleInitialState

func (r *SampleReconciler) HandleInitialState(ctx context.Context, objectInstance *v1alpha1.Sample) error

HandleInitialState bootstraps state handling for the reconciled resource.

func (*SampleReconciler) HandleProcessingState

func (r *SampleReconciler) HandleProcessingState(ctx context.Context, objectInstance *v1alpha1.Sample) error

HandleProcessingState processes the reconciled resource by processing the underlying resources. Based on the processing either a success or failure state is set on the reconciled resource.

func (*SampleReconciler) HandleReadyState

func (r *SampleReconciler) HandleReadyState(ctx context.Context, objectInstance *v1alpha1.Sample) error

HandleReadyState checks for the consistency of reconciled resource, by verifying the underlying resources.

func (*SampleReconciler) Reconcile

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

Reconcile is the entry point from the controller-runtime framework. It performs a reconciliation based on the passed ctrl.Request object.

func (*SampleReconciler) SetupWithManager

func (r *SampleReconciler) SetupWithManager(mgr ctrl.Manager, rateLimiter RateLimiter) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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