Producer-aware sources

Point a stage at the resource that produces an artifact, and the controller
finds the ExternalArtifact that producer publishes. This is the third source
route, alongside the two direct ones — an ExternalArtifact (the default
sourceRef.kind) or a Flux GitRepository/OCIRepository/Bucket — covered in
stages and sources
. Reach for it when an
operator publishes an ExternalArtifact from a custom resource (for example
JaaS
rendering Jsonnet).
Referencing a producer
Set kind (and apiVersion) to a producer resource, and the controller resolves
it to the ExternalArtifact that producer publishes — the one whose
spec.sourceRef back-references the producer (matched on group, kind, and name).
For example, a JaaS
JsonnetSnippet
renders Jsonnet and publishes an ExternalArtifact; reference the snippet and the
controller follows the link:
spec:
stages:
- name: dashboards
sourceRef:
apiVersion: jaas.metio.wtf/v1
kind: JsonnetSnippet
name: grafana-dashboards
The controller also watches the common Flux source kinds (GitRepository,
OCIRepository, Bucket) so a stage re-reconciles when an upstream source
changes.
A producer can itself consume another producer first: a JaaS JsonnetSnippet can
render from the artifact another snippet publishes. That chaining happens on the
producer side — see
chaining snippets
.
A stage references only the final producer and reads the ExternalArtifact it
publishes.
Related projects
JOI, JaaS, and StageSet compose end to end:
- JOI
publishes Jsonnet
libraries as single-layer OCI images (usable both as image-volume mounts and as
Flux
OCIRepositorysources). - JaaS
evaluates Jsonnet — optionally
importing those JOI libraries — and publishes the rendered JSON as an
ExternalArtifact. StageSetreferences theJsonnetSnippet(or its artifact) and rolls the result out in ordered, gated stages.
Each project is independently useful; a stage reads straight from a
GitRepository, OCIRepository, or Bucket, or from any ExternalArtifact
regardless of what produced it.