controllers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentPlanReconciler

type ComponentPlanReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

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, 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.

func (*ComponentPlanReconciler) UpdateImages

func (r *ComponentPlanReconciler) UpdateImages(ctx context.Context, jsonManifests []string, repoOverride []corev1alpha1.ImageOverride, images []kustomize.Image) (jsonData []string, diffStr string, err error)

func (*ComponentPlanReconciler) UpdateManifestConfigMapLabel

func (r *ComponentPlanReconciler) UpdateManifestConfigMapLabel(ctx context.Context, plan *corev1alpha1.ComponentPlan, val corev1alpha1.ConditionReason) (err error)

type ComponentReconciler

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

ComponentReconciler reconciles a Component object

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. TODO(user): Modify the Reconcile function to compare the state specified by the Component 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 (*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.

type RepositoryReconciler

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

	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.

func (*RepositoryReconciler) UpdateRepository

func (r *RepositoryReconciler) UpdateRepository(ctx context.Context, logger logr.Logger, instance *corev1alpha1.Repository) (bool, error)

type SubscriptionPredicate

type SubscriptionPredicate struct {
	predicate.Funcs
}

func (SubscriptionPredicate) Delete

func (SubscriptionPredicate) Update

type SubscriptionReconciler

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

SubscriptionReconciler reconciles a Subscription object

func (*SubscriptionReconciler) CreateComponentPlan

CreateComponentPlan 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