Documentation
¶
Overview ¶
Package source reconciles Flux source CRs (GitRepository, OCIRepository, Bucket, ExternalArtifact, HelmRepository) into on-disk artifacts via per-kind Fetcher implementations from pkg/source, then publishes the result to the Store. Mirrors pkg/controllers/{kustomization,helmrelease}.
The controller does not know about individual source kinds — it dispatches via the Fetchers map keyed by id.Kind, so adding a new kind is a one-line registration at orchestrator-construction time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
*base.Controller
// Fetchers maps source kinds to their fetchers. Kinds without an entry
// are ignored. Register fetchers before StartLifecycle.
Fetchers map[string]src.Fetcher
// contains filtered or unexported fields
}
Controller watches the Store for source-kind objects, fetches each into an on-disk artifact via the matching Fetcher, and updates the Store with the result.
func New ¶
func New(s *store.Store, t *task.Service) *Controller
New constructs a source controller. Register fetchers on the returned struct's Fetchers map before StartLifecycle.
func (*Controller) Configure ¶
func (c *Controller) Configure(opts FetchOptions, retry cache.RetryConfig)
Configure installs the post-bootstrap state. Panics if called after StartLifecycle.
func (*Controller) Owns ¶ added in v0.4.14
func (c *Controller) Owns(id manifest.NamedResource) bool
Owns reports whether id is a node this controller reconciles — the dag Dispatcher uses it to route source nodes to ReconcileNode. A registered kind is not enough: kind names are not unique across API groups, and a foreign CRD reusing one (seaweed.seaweedfs.com Bucket) parses to a RawObject that the kind's Fetcher would reject as an unexpected payload. An id absent from the store still counts as ours — reporting the vanished object is the controller's job.
func (*Controller) ReconcileNode ¶ added in v0.3.4
func (c *Controller) ReconcileNode( ctx context.Context, id manifest.NamedResource, level manifest.DrainLevel, previous schedule.Result, ) *base.Execution
ReconcileNode returns the captured assessment of a source acquisition.
type FetchOptions ¶
type FetchOptions struct {
// Loader borrows the invocation's declaration admission boundary.
Loader *loader.Loader
Session *selection.Session
AllowMissingSecrets bool
// Admission resolves runtime sources against immutable discovery policy.
Admission *discovery.Admission
}
FetchOptions carries the post-bootstrap state the orchestrator wires onto the controller. Filter narrows fetches to sources referenced by changed resources in changed-only mode.