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 ¶
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) 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.