controller

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleReleaseReconciler

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

BundleReleaseReconciler reconciles a BundleRelease object

func (*BundleReleaseReconciler) Reconcile

func (r *BundleReleaseReconciler) 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 BundleRelease object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

Note: BundleRelease does not impersonate a ServiceAccount on deletion; it orchestrates child ModuleReleases only. The DeletionSAMissing stall (handleDeletionImpersonationFailure in internal/reconcile/modulerelease.go) therefore does not apply here. If bundle reconcile ever grows a direct apply or prune path, apply the same SA-missing guardrail.

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

func (*BundleReleaseReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ModuleReleaseReconciler

type ModuleReleaseReconciler struct {
	client.Client
	// APIReader is an uncached reader (manager.GetAPIReader()) used for one-off
	// reads that must not provision a cache informer.
	APIReader       client.Reader
	Scheme          *runtime.Scheme
	RestConfig      *rest.Config
	Provider        *provider.Provider
	ResourceManager *fluxssa.ResourceManager
	EventRecorder   events.EventRecorder
	Renderer        render.ModuleRenderer
	// DefaultServiceAccount is the fallback SA name used when a
	// ModuleRelease has an empty spec.serviceAccountName. Resolved in the
	// release's own namespace. Empty disables the default.
	DefaultServiceAccount string
}

ModuleReleaseReconciler reconciles a ModuleRelease object. Dependencies are injected via struct fields at manager setup time.

func (*ModuleReleaseReconciler) Reconcile

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

Reconcile runs the full ModuleRelease reconcile loop: CUE module synthesis and resolution from OCI registry, rendering, SSA apply, optional prune, and status commit.

func (*ModuleReleaseReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ReleaseReconciler

type ReleaseReconciler struct {
	client.Client
	// APIReader is an uncached reader (manager.GetAPIReader()) used for one-off
	// reads that must not provision a cache informer.
	APIReader       client.Reader
	Scheme          *runtime.Scheme
	RestConfig      *rest.Config
	Provider        *provider.Provider
	ResourceManager *fluxssa.ResourceManager
	EventRecorder   events.EventRecorder

	// Fetcher downloads Flux source artifacts. Injected for testability.
	Fetcher opmsource.Fetcher

	// Renderer loads and renders the CUE release package from the extracted
	// artifact directory. Injected for testability.
	Renderer render.ReleaseRenderer

	// DefaultServiceAccount is the fallback SA name used when a Release has
	// an empty spec.serviceAccountName. Resolved in the release's own
	// namespace. Empty disables the default.
	DefaultServiceAccount string
}

ReleaseReconciler reconciles a Release object.

func (*ReleaseReconciler) Reconcile

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

Reconcile runs the full Release reconcile loop: source resolution, artifact fetch, path navigation, CUE load, kind detection, render, apply, prune, and status commit.

func (*ReleaseReconciler) SetupWithManager

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

SetupWithManager wires the controller into mgr. Watches:

  • Release CRs (primary, generation-change predicate)
  • OCIRepository, GitRepository, Bucket (artifact-change predicate, mapped to referencing Releases)

Jump to

Keyboard shortcuts

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