reconciler

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 58 Imported by: 0

Documentation

Overview

Package config reads the initial global configuration.

Index

Constants

View Source
const MaxReportedNonReadyClusters = 10

Variables

View Source
var LongRetry = wait.Backoff{
	Steps:    5,
	Duration: 5 * time.Second,
	Factor:   1.0,
	Jitter:   0.1,
}

Functions

func CheckRetryable added in v0.14.0

func CheckRetryable(err error, logger logr.Logger) (bool, ctrl.Result, error)

CheckRetryable checks if err is retryable; if so, it returns `true`, along with a controller result triggering a requeue after the default duration. If err is non-retryable, it simply returns `false` with empty/nil values.

func Load

func Load(ctx context.Context, c client.Reader, namespace string) error

Load the config from the configmap and set it in the config package.

func SetCondition added in v0.14.0

func SetCondition[T any](cond string, s copyable[T], err error)

SetCondition sets the condition and updates the timestamp, if the condition changed

Types

type BundleDeploymentReconciler

type BundleDeploymentReconciler struct {
	client.Client
	Scheme  *runtime.Scheme
	ShardID string

	Workers int
}

BundleDeploymentReconciler reconciles a BundleDeployment object

func (*BundleDeploymentReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*BundleDeploymentReconciler) SetupWithManager

func (r *BundleDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BundleQuery

type BundleQuery interface {
	// BundlesForCluster is used to map from a cluster to bundles
	BundlesForCluster(context.Context, *fleet.Cluster) ([]*fleet.Bundle, []*fleet.Bundle, error)
}

type BundleReconciler

type BundleReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder

	Builder TargetBuilder
	Store   Store
	Query   BundleQuery
	ShardID string

	Workers int
}

BundleReconciler reconciles a Bundle object

func (*BundleReconciler) Reconcile

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

Reconcile creates bundle deployments for a bundle nolint:gocyclo

func (*BundleReconciler) SetupWithManager

func (r *BundleReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ClusterGroupReconciler

type ClusterGroupReconciler struct {
	client.Client
	Scheme  *runtime.Scheme
	ShardID string

	Workers int
}

ClusterGroupReconciler reconciles a ClusterGroup object

func (*ClusterGroupReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ClusterGroupReconciler) SetupWithManager

func (r *ClusterGroupReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ClusterReconciler

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

	Query   BundleQuery
	ShardID string

	Workers int
}

ClusterReconciler reconciles a Cluster object

func (*ClusterReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ClusterReconciler) SetupWithManager

func (r *ClusterReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ClusterScheduledMatcher added in v0.14.0

type ClusterScheduledMatcher struct {
	// contains filtered or unexported fields
}

ClusterScheduledMatcher implements the quarts.Matcher interface to match for Scheduled clusters.

func NewClusterScheduledMatcher added in v0.14.0

func NewClusterScheduledMatcher(namespace, name string) *ClusterScheduledMatcher

func (*ClusterScheduledMatcher) IsMatch added in v0.14.0

IsMatch implements the quartz.Matcher interface and returns true if the cluster stored in the matcher is found in any of the matching clusters of the given job. Returns false otherwise.

type ConfigReconciler

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

	SystemNamespace string
	ShardID         string
}

ConfigReconciler reconciles the Fleet config object, by reloading the config on change.

func (*ConfigReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ConfigReconciler) SetupWithManager

func (r *ConfigReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type CronDurationJob added in v0.14.0

type CronDurationJob struct {
	Started          bool
	Schedule         *fleet.Schedule
	Scheduler        quartz.Scheduler
	Matcher          *matcher.ScheduleMatch
	MatchingClusters []string
	Location         *time.Location
	// contains filtered or unexported fields
}

func (*CronDurationJob) Description added in v0.14.0

func (c *CronDurationJob) Description() string

Description implements the quartz.Job interface function to describe a scheduled job.

func (*CronDurationJob) Execute added in v0.14.0

func (c *CronDurationJob) Execute(ctx context.Context) error

Execute implements the quartz.Job interface function to run a scheduled job.

type ImageScanReconciler

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

	Scheduler quartz.Scheduler
	ShardID   string

	Workers int
}

ImageScanReconciler reconciles a ImageScan object

func (*ImageScanReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*ImageScanReconciler) SetupWithManager

func (r *ImageScanReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ScheduleReconciler added in v0.14.0

type ScheduleReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	Recorder  record.EventRecorder
	ShardID   string
	Workers   int
	Scheduler quartz.Scheduler
}

ScheduleReconciler reconciles a Schedule object

func (*ScheduleReconciler) Reconcile added in v0.14.0

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

func (*ScheduleReconciler) SetupWithManager added in v0.14.0

func (r *ScheduleReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type Store

type Store interface {
	Store(context.Context, *manifest.Manifest) error
}

type TargetBuilder

type TargetBuilder interface {
	Targets(ctx context.Context, bundle *fleet.Bundle, manifestID string) ([]*target.Target, error)
}

type TypedResourceVersionUnchangedPredicate added in v0.12.9

type TypedResourceVersionUnchangedPredicate[T metav1.Object] struct {
	predicate.TypedFuncs[T]
}

TypedResourceVersionUnchangedPredicate implements a update predicate to allow syncPeriod to trigger the reconciler

func (TypedResourceVersionUnchangedPredicate[T]) Create added in v0.12.9

func (TypedResourceVersionUnchangedPredicate[T]) Delete added in v0.12.9

func (TypedResourceVersionUnchangedPredicate[T]) Generic added in v0.12.9

func (TypedResourceVersionUnchangedPredicate[T]) Update added in v0.12.9

Update implements default UpdateEvent filter for validating resource version change.

Jump to

Keyboard shortcuts

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