source

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package source is the source-controller's engine: the reconcilers for the Forge and Repository kinds. The Forge reconciler validates credentials and stamps readiness; the Repository reconciler resolves the covering Forge, pins the head SHA exactly once, downloads the forge's tarball archive at that SHA (pure HTTP; controllers carry no git binary), and publishes it through the artifact store for agent jobs to fetch credential-lessly.

Index

Constants

View Source
const DefaultMaxArtifactBytes = int64(1) << 30 // 1 GiB

DefaultMaxArtifactBytes caps a stored tarball; larger repositories stall the Repository instead of exhausting artifact storage.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForgeReconciler

type ForgeReconciler struct {
	client.Client
	// Forges mints and validates credentials (shared with the Repository
	// reconciler).
	Forges *forge.Store
	// Log receives reconcile diagnostics; nil discards.
	Log *slog.Logger
}

ForgeReconciler validates Forge credentials and maintains the Ready condition.

func (*ForgeReconciler) Reconcile

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

Reconcile implements the Forge control loop.

func (*ForgeReconciler) SetupWithManager

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

SetupWithManager wires the reconciler.

type RepositoryReconciler

type RepositoryReconciler struct {
	client.Client
	// Forges resolves and authenticates forge access.
	Forges *forge.Store
	// Artifacts stores and serves the tarballs.
	Artifacts *artifact.Store
	// MaxArtifactBytes caps a tarball; zero means DefaultMaxArtifactBytes.
	MaxArtifactBytes int64
	// ClientFor returns the forge API client for a resolution; nil uses the
	// Forges store (tests substitute a fake).
	ClientFor func(ctx context.Context, res *forge.Resolved) (forgeClient, error)
	// Log receives reconcile diagnostics; nil discards.
	Log *slog.Logger
}

RepositoryReconciler produces the SHA-pinned tarball artifact for each Repository: resolve the covering Forge, pin the head SHA once, download the archive, publish it through the artifact store.

func (*RepositoryReconciler) Reconcile

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

Reconcile implements the Repository control loop.

func (*RepositoryReconciler) SetupWithManager

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

SetupWithManager wires the reconciler: its own kind, plus a Forge watch that re-queues every Repository in the namespace. A Forge created or re-scoped after ingest must resolve previously-unresolvable repositories without human action.

Jump to

Keyboard shortcuts

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