environments

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Overview

build.go reconciles the Build CR: routes create/update/delete through the core CQRS engine and, on setup, wires the Build domain's mediator, backend providers (Buildah, Kaniko, Buildpacks), and service into the domain registry.

The finalizer (buildFinalizer) gates deletion until the engine's CmdDelete path — mediator CleanupPrerequisites plus domain teardown — completes.

This file holds what the ServiceUnit and Deployment controllers share to follow a Build's image.

A ServiceUnit of type BUILD names a Build and runs the image that Build last pushed. The buildrun observer records that image on the Build's status when a BuildRun succeeds. Nothing in the ServiceUnit or the Deployment changes when it does, so both controllers watch Builds and re-reconcile the objects that depend on the one whose image changed.

deployment.go reconciles the Deployment CR: routes create/update/delete through the core CQRS engine and, on setup, wires the Deployment domain's mediator, runtime provider, Kustomize reconciliation executor, and service into the domain registry.

The finalizer (deploymentFinalizer) gates deletion until the engine's CmdDelete path completes, mirroring build.go.

environment.go reconciles the Environment CR — the root of the delivery chain — routing every change through the core CQRS engine and, on setup, registering the Environment domain.

The domain is intentionally minimal at this stage (see the comment in SetupWithManager): no finalizer yet, since there's nothing external to tear down until secret-store connection testing and the ref-patcher observer land.

package.go reconciles the Package CR: routes create/update through the core CQRS engine and, on setup, wires the Package domain's mediator, kapp-controller provider, and service into the domain registry.

Like build.go and deployment.go, deletion is gated by a finalizer: the domain tears the Package down before the finalizer is removed.

serviceunit.go reconciles the ServiceUnit CR, routing create/update through the core CQRS engine.

SetupWithManager does not yet construct a mediator, provider, or service, or call registry.RegisterDomain — see internal/domains/ serviceunit for where that would plug in once it exists.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildReconciler

type BuildReconciler struct {
	client.Client
	KubeClient    kubernetes.Interface
	BuildClient   buildclientset.Interface
	BuildService  *buildapp.BuildService
	Scheme        *runtime.Scheme
	BuildMediator *build.Mediator
	Log           logr.Logger
	Runtime       *runtimeinfra.Runtime
	Recorder      events.EventRecorder
}

BuildReconciler reconciles a Build object

func (*BuildReconciler) Reconcile

func (r *BuildReconciler) 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 Build 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.23.1/pkg/reconcile

func (*BuildReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type DeploymentReconciler

type DeploymentReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger

	Recorder           events.EventRecorder
	Runtime            *runtimeinfra.Runtime
	DeploymentMediator *deployment.Mediator
	DeploymentService  *application.DeploymentService
	// contains filtered or unexported fields
}

DeploymentReconciler reconciles a Deployment object

func (*DeploymentReconciler) Reconcile

func (r *DeploymentReconciler) 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 Deployment 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.23.1/pkg/reconcile

func (*DeploymentReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type EnvironmentReconciler

type EnvironmentReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Log      logr.Logger
	Runtime  *runtimeinfra.Runtime
	Recorder events.EventRecorder
}

EnvironmentReconciler reconciles an Environment object.

func (*EnvironmentReconciler) Reconcile

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

Reconcile fetches the Environment, routes it through the core CQRS engine, and persists the resulting status with conflict retry.

func (*EnvironmentReconciler) SetupWithManager

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

SetupWithManager registers the Environment domain with the core engine and wires the reconciler into the controller manager, watching Environment CRs.

type PackageReconciler

type PackageReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger

	PackageMediator *pkgMediator.Mediator
	Runtime         *runtimeinfra.Runtime
	Recorder        events.EventRecorder
}

PackageReconciler reconciles a Package object

func (*PackageReconciler) Reconcile

func (r *PackageReconciler) 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 Package 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.23.1/pkg/reconcile

func (*PackageReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ServiceUnitReconciler

type ServiceUnitReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Log      logr.Logger
	Runtime  *runtimeinfra.Runtime
	Recorder events.EventRecorder
}

ServiceUnitReconciler reconciles a ServiceUnit object

func (*ServiceUnitReconciler) Reconcile

func (r *ServiceUnitReconciler) 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 ServiceUnit 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.23.1/pkg/reconcile

func (*ServiceUnitReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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