application

package
v0.9.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConditionTypeReady indicates whether all Application resources have been
	// successfully reconciled and the Deployment is available.
	ConditionTypeReady = "Ready"

	// ConditionTypeProgressing indicates the Deployment is rolling out new pods.
	ConditionTypeProgressing = "Progressing"

	// ReasonObservationError is used when a transient error prevents the controller
	// from reading the workload's current state.
	ReasonObservationError = "ObservationError"
)

Variables

This section is empty.

Functions

func CleanupCronJob

func CleanupCronJob(ctx context.Context, c client.Client, app *workloadv1alpha1.Application) error

CleanupCronJob deletes the CronJob owned by the Application if it exists. This is called when transitioning from CronJob mode back to Deployment mode.

func CleanupDeployment

func CleanupDeployment(ctx context.Context, c client.Client, app *workloadv1alpha1.Application) error

CleanupDeployment deletes the Deployment owned by the Application if it exists. This is called when transitioning from Deployment mode to CronJob mode.

func CleanupJob

CleanupJob deletes the Job owned by the Application if it exists. This is called when transitioning away from Job mode to another WorkloadType.

func CleanupOwnedResource

func CleanupOwnedResource[T client.Object](ctx context.Context, c client.Client, app *workloadv1alpha1.Application, obj T, resourceType string) error

CleanupOwnedResource deletes a resource only if it exists and is owned by the given Application. It uses the OwnerReference UID to prevent accidentally deleting same-named resources created outside of this operator (e.g. by a workspace admin). This is called when transitioning between WorkloadTypes to remove stale resources.

func CleanupPVC

CleanupPVC deletes the PersistentVolumeClaim owned by the Application if it exists. This is called when transitioning from Deployment mode to CronJob mode.

func CleanupService

func CleanupService(ctx context.Context, c client.Client, app *workloadv1alpha1.Application) error

CleanupService deletes the Service owned by the Application if it exists. This is called when transitioning from Deployment mode to CronJob mode.

func LabelsForApplication

func LabelsForApplication(name, version string) map[string]string

LabelsForApplication returns a standard set of labels for resources managed by this operator.

func ReconcileCronJob

func ReconcileCronJob(ctx context.Context, c client.Client, scheme *runtime.Scheme, app *workloadv1alpha1.Application, version string) error

ReconcileCronJob ensures the CronJob exists and matches the desired state declared in Application.Spec.CronJob.

func ReconcileDeployment

func ReconcileDeployment(ctx context.Context, c client.Client, scheme *runtime.Scheme, app *workloadv1alpha1.Application, version string) error

ReconcileDeployment ensures the Deployment exists and matches the desired state declared in Application.Spec.Deployment.

func ReconcileJob

func ReconcileJob(ctx context.Context, c client.Client, scheme *runtime.Scheme, app *workloadv1alpha1.Application, version string) error

ReconcileJob ensures the Job exists and matches the desired state declared in Application.Spec.Job.

Job spec is largely immutable after creation (Kubernetes rejects most field changes). Therefore the spec is only written on initial creation; subsequent reconcile loops only synchronize labels and the OwnerReference.

func ReconcilePVC

func ReconcilePVC(ctx context.Context, c client.Client, scheme *runtime.Scheme, app *workloadv1alpha1.Application, version string) error

ReconcilePVC ensures the PersistentVolumeClaim matches the desired state or is deleted when the spec is removed.

Most PVC spec fields are immutable after the claim is bound. The only mutable field is spec.resources.requests.storage, which supports volume expansion when the StorageClass has allowVolumeExpansion: true. On update, we synchronize the storage request along with labels and owner references.

func ReconcileService

func ReconcileService(ctx context.Context, c client.Client, scheme *runtime.Scheme, app *workloadv1alpha1.Application, version string) error

ReconcileService ensures the Service matches the desired state or is deleted when the spec is removed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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