controllers

package
v0.0.0-...-50752a0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 70 Imported by: 1

Documentation

Index

Constants

View Source
const CDQReconcileTimeout = 5 * time.Minute

CDQReconcileTimeout is the default timeout, 5 mins, for the context of cdq reconcile

Variables

This section is empty.

Functions

func MapComponentToApplication

func MapComponentToApplication() func(object client.Object) []reconcile.Request

MapComponentToApplication returns an event handler that will convert events on a Component CR to events on its parent Application

func MapToBindingByBoundObjectName

func MapToBindingByBoundObjectName(cl client.Client, objectType, label string) func(object client.Object) []reconcile.Request

MapToBindingByBoundObjectName maps the bound object (Environment) to the associated Bindings. The correct Bindings are listed using the given label whose value should equal to the object's name. Adapted from https://github.com/codeready-toolchain/host-operator/blob/master/controllers/spacebindingcleanup/mapper.go#L17

Types

type ApplicationReconciler

type ApplicationReconciler struct {
	client.Client
	Scheme            *runtime.Scheme
	Log               logr.Logger
	GitHubTokenClient github.GitHubToken
	GitHubOrg         string
}

ApplicationReconciler reconciles a Application object

func (*ApplicationReconciler) AddFinalizer

func (r *ApplicationReconciler) AddFinalizer(ctx context.Context, application *appstudiov1alpha1.Application) error

AddFinalizer adds the finalizer to the Application CR and initiates the finalize count on the annotation

func (*ApplicationReconciler) Finalize

func (r *ApplicationReconciler) Finalize(ctx context.Context, application *appstudiov1alpha1.Application, ghClient *github.GitHubClient) error

Finalize deletes the corresponding GitOps repo for the given Application CR.

func (*ApplicationReconciler) Reconcile

func (r *ApplicationReconciler) 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 Application 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.9.2/pkg/reconcile

func (*ApplicationReconciler) SetCreateConditionAndUpdateCR

func (r *ApplicationReconciler) SetCreateConditionAndUpdateCR(ctx context.Context, req ctrl.Request, application *appstudiov1alpha1.Application, createError error)

func (*ApplicationReconciler) SetUpdateConditionAndUpdateCR

func (r *ApplicationReconciler) SetUpdateConditionAndUpdateCR(ctx context.Context, req ctrl.Request, application *appstudiov1alpha1.Application, updateError error)

func (*ApplicationReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ComponentDetectionQueryReconciler

type ComponentDetectionQueryReconciler struct {
	client.Client
	Scheme             *runtime.Scheme
	Log                logr.Logger
	GitHubTokenClient  github.GitHubToken
	DevfileRegistryURL string
	AppFS              afero.Afero
	RunKubernetesJob   bool
	Config             *rest.Config
	CdqAnalysisImage   string
	CDQUtil            cdqanalysis.CDQUtil
}

ComponentDetectionQueryReconciler reconciles a ComponentDetectionQuery object

func (*ComponentDetectionQueryReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the ComponentDetectionQuery 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.9.2/pkg/reconcile

func (*ComponentDetectionQueryReconciler) SetCompleteConditionAndUpdateCR

func (r *ComponentDetectionQueryReconciler) SetCompleteConditionAndUpdateCR(ctx context.Context, req ctrl.Request, componentDetectionQuery *appstudiov1alpha1.ComponentDetectionQuery, originalCDQ *appstudiov1alpha1.ComponentDetectionQuery, completeError error)

func (*ComponentDetectionQueryReconciler) SetDetectingConditionAndUpdateCR

func (r *ComponentDetectionQueryReconciler) SetDetectingConditionAndUpdateCR(ctx context.Context, req ctrl.Request, componentDetectionQuery *appstudiov1alpha1.ComponentDetectionQuery)

func (*ComponentDetectionQueryReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ComponentReconciler

type ComponentReconciler struct {
	client.Client
	Scheme             *runtime.Scheme
	Log                logr.Logger
	GitHubOrg          string
	Generator          gitopsgen.Generator
	AppFS              afero.Afero
	SPIClient          spi.SPI
	GitHubTokenClient  github.GitHubToken
	DevfileUtilsClient devfileParserUtil.DevfileUtils
}

ComponentReconciler reconciles a Component object

func (*ComponentReconciler) AddFinalizer

func (r *ComponentReconciler) AddFinalizer(ctx context.Context, component *appstudiov1alpha1.Component) error

AddFinalizer adds the finalizer to the Component CR

func (*ComponentReconciler) Finalize

func (r *ComponentReconciler) Finalize(ctx context.Context, component *appstudiov1alpha1.Component, application *appstudiov1alpha1.Application, ghClient *github.GitHubClient, token string) error

Finalize deletes the corresponding devfile project or the devfile attribute entry from the Application CR and also deletes the corresponding GitOps repo's Component dir & updates the parent kustomize for the given Component CR.

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.9.2/pkg/reconcile

func (*ComponentReconciler) SetCreateConditionAndUpdateCR

func (r *ComponentReconciler) SetCreateConditionAndUpdateCR(ctx context.Context, req ctrl.Request, component *appstudiov1alpha1.Component, createError error) error

func (*ComponentReconciler) SetGitOpsGeneratedConditionAndUpdateCR

func (r *ComponentReconciler) SetGitOpsGeneratedConditionAndUpdateCR(ctx context.Context, req ctrl.Request, component *appstudiov1alpha1.Component, generateError error) error

func (*ComponentReconciler) SetUpdateConditionAndUpdateCR

func (r *ComponentReconciler) SetUpdateConditionAndUpdateCR(ctx context.Context, req ctrl.Request, component *appstudiov1alpha1.Component, updateError error) error

func (*ComponentReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type GitOpsCommitIdError

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

func (*GitOpsCommitIdError) Error

func (e *GitOpsCommitIdError) Error() string

type GitOpsParseRepoError

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

func (*GitOpsParseRepoError) Error

func (e *GitOpsParseRepoError) Error() string

type NotSupported

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

func (*NotSupported) Error

func (e *NotSupported) Error() string

type SnapshotEnvironmentBindingReconciler

type SnapshotEnvironmentBindingReconciler struct {
	client.Client
	Scheme            *runtime.Scheme
	Log               logr.Logger
	AppFS             afero.Afero
	Generator         gitopsgen.Generator
	GitHubTokenClient github.GitHubToken
}

SnapshotEnvironmentBindingReconciler reconciles a SnapshotEnvironmentBinding object

func (*SnapshotEnvironmentBindingReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the SnapshotEnvironmentBinding 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.9.2/pkg/reconcile

func (*SnapshotEnvironmentBindingReconciler) SetConditionAndUpdateCR

func (r *SnapshotEnvironmentBindingReconciler) SetConditionAndUpdateCR(ctx context.Context, req ctrl.Request, appSnapshotEnvBinding *appstudiov1alpha1.SnapshotEnvironmentBinding, createError error)

func (*SnapshotEnvironmentBindingReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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