controllers

package
v0.1.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ComponentIndexKey  = "metadata.component"
	RepositoryIndexKey = "metadata.repository"
	DiffTimeDuration   = time.Minute
)

Variables

This section is empty.

Functions

func GetConflicts added in v0.1.4

func GetConflicts(c client.Client, ctx context.Context, portal *corev1alpha1.Portal) ([]string, []string, error)

GetConflicts returns the entry and path conflicts for a given portal.

Types

type ComponentPlanReconciler

type ComponentPlanReconciler struct {
	client.Client
	Recorder   record.EventRecorder
	Scheme     *runtime.Scheme
	WorkerPool helm.ReleaseWorkerPool
}

ComponentPlanReconciler reconciles a ComponentPlan object

func (*ComponentPlanReconciler) GenerateManifestConfigMap

func (r *ComponentPlanReconciler) GenerateManifestConfigMap(plan *corev1alpha1.ComponentPlan, manifest *corev1.ConfigMap, data string) (err error)

func (*ComponentPlanReconciler) PatchCondition

func (r *ComponentPlanReconciler) PatchCondition(ctx context.Context, plan *corev1alpha1.ComponentPlan, logger logr.Logger, revision int, isDone, isFailed bool, condition ...corev1alpha1.Condition) (err error)

PatchCondition patch subscription status condition

func (*ComponentPlanReconciler) Reconcile

func (r *ComponentPlanReconciler) 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. For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*ComponentPlanReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ComponentReconciler

type ComponentReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	Recorder  record.EventRecorder
	ChartWork helm.ChartWorker
}

ComponentReconciler reconciles a Component object

func (*ComponentReconciler) DeleteComponentConfigMaps added in v0.1.6

func (r *ComponentReconciler) DeleteComponentConfigMaps(ctx context.Context, name, namespace string, versions []string, logger logr.Logger) bool

func (*ComponentReconciler) OnComponentCreate added in v0.1.2

func (r *ComponentReconciler) OnComponentCreate(event event.CreateEvent) bool

func (*ComponentReconciler) OnComponentDel added in v0.1.2

func (r *ComponentReconciler) OnComponentDel(event event.DeleteEvent) bool

func (*ComponentReconciler) OnComponentUpdate

func (r *ComponentReconciler) OnComponentUpdate(event event.UpdateEvent) bool

OnComponentUpdate checks if a reconcile process is needed when updating. Default true.

func (*ComponentReconciler) Reconcile

func (r *ComponentReconciler) 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.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*ComponentReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*ComponentReconciler) UpdateComponent

func (r *ComponentReconciler) UpdateComponent(ctx context.Context, logger logr.Logger, instance *corev1alpha1.Component) (bool, error)

UpdateComponent updates new component, add finalizer if necessary.

func (*ComponentReconciler) UpdateValuesConfigmap added in v0.1.6

func (r *ComponentReconciler) UpdateValuesConfigmap(ctx context.Context, logger logr.Logger, component *corev1alpha1.Component, repo *corev1alpha1.Repository) (err error)

type PortalPredicate added in v0.1.4

type PortalPredicate struct {
	predicate.Funcs
}

func (PortalPredicate) Update added in v0.1.4

func (p PortalPredicate) Update(ue event.UpdateEvent) bool

type PortalReconciler added in v0.1.4

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

	Recorder record.EventRecorder
}

PortalReconciler reconciles a Portal object

func (*PortalReconciler) Reconcile added in v0.1.4

func (r *PortalReconciler) 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.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile

func (*PortalReconciler) SetupWithManager added in v0.1.4

func (r *PortalReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type RatingReconciler added in v0.1.4

type RatingReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

RatingReconciler reconciles a Rating object

func (*RatingReconciler) CreatePipelineRun added in v0.1.5

func (r *RatingReconciler) CreatePipelineRun(logger logr.Logger, ctx context.Context, instance *corev1alpha1.Rating) error

func (*RatingReconciler) DeletePipeline added in v0.1.5

func (r *RatingReconciler) DeletePipeline(ctx context.Context, instance *corev1alpha1.Rating) error

Before creating pipelinerun, we shoulde delete all the existing pipelineruns.

func (*RatingReconciler) PipelineRunUpdate added in v0.1.5

func (r *RatingReconciler) PipelineRunUpdate(logger logr.Logger) func(event.UpdateEvent, workqueue.RateLimitingInterface)

func (*RatingReconciler) Reconcile added in v0.1.4

func (r *RatingReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the Rating object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile

func (*RatingReconciler) SetupWithManager added in v0.1.4

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

SetupWithManager sets up the controller with the Manager.

type RepositoryReconciler

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

	C map[string]repository.IWatcher
}

RepositoryReconciler reconciles a Repository object

func (*RepositoryReconciler) OnRepositryUpdate

func (r *RepositoryReconciler) OnRepositryUpdate(u event.UpdateEvent) bool

func (*RepositoryReconciler) Reconcile

func (r *RepositoryReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the Repository object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*RepositoryReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type SubscriptionPredicate

type SubscriptionPredicate struct {
	predicate.Funcs
}

func (SubscriptionPredicate) Delete

func (SubscriptionPredicate) Update

type SubscriptionReconciler

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

	// Now is a function that returns current time, done to facilitate unit tests
	Now func() time.Time
}

SubscriptionReconciler reconciles a Subscription object

func (*SubscriptionReconciler) CreateOrUpdateComponentPlan added in v0.1.6

func (r *SubscriptionReconciler) CreateOrUpdateComponentPlan(ctx context.Context, sub *corev1alpha1.Subscription, fetch corev1alpha1.ComponentVersion) (err error)

CreateOrUpdateComponentPlan create component plan if not exists or update component plan if exists

func (*SubscriptionReconciler) GetReqs

func (r *SubscriptionReconciler) GetReqs(ctx context.Context, o client.Object, watchComponent bool) (reqs []reconcile.Request)

GetReqs get subscription reqs

func (*SubscriptionReconciler) PatchCondition

func (r *SubscriptionReconciler) PatchCondition(ctx context.Context, sub *corev1alpha1.Subscription, condition corev1alpha1.Condition) (err error)

PatchCondition patch subscription status condition

func (*SubscriptionReconciler) Reconcile

func (r *SubscriptionReconciler) 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. For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.12.2/pkg/reconcile

func (*SubscriptionReconciler) SetupWithManager

func (r *SubscriptionReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*SubscriptionReconciler) UpdateStatusInstalled

func (r *SubscriptionReconciler) UpdateStatusInstalled(ctx context.Context, logger logr.Logger, sub *corev1alpha1.Subscription, fetch corev1alpha1.ComponentVersion) (err error)

UpdateStatusInstalled update subscription status installed

func (*SubscriptionReconciler) UpdateStatusRepositoryHealth

func (r *SubscriptionReconciler) UpdateStatusRepositoryHealth(ctx context.Context, logger logr.Logger, sub *corev1alpha1.Subscription) (err error)

UpdateStatusRepositoryHealth get repository CR, check if the repository is healthy and updates subscription status.RepositoryHealth

Jump to

Keyboard shortcuts

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