images

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package images decides where ate-setup gets container images from.

The manifests name images as ko:// import paths, which ko builds and publishes on every install. That needs a checkout, a Go toolchain, and a registry to push to. Installing an already-published release instead means mapping those same references onto images that exist, which is what Source describes and Prebuilt performs.

Index

Constants

View Source
const ModulePath = "github.com/agent-substrate/substrate"

ModulePath is this repository's module path. A ko:// reference is it joined with a component's package.

Variables

View Source
var Components = []string{
	"cmd/ateapi",
	"cmd/atecontroller",
	"cmd/atelet",
	"cmd/atenet",
	"cmd/ateom-gvisor",
	"cmd/ateom-microvm",
	"cmd/podcertcontroller",
	"demos/counter",
	"demos/egress",
	"demos/multi-template/fspersist",
	"demos/sandbox",
}

Components is every package the installer can deploy a published image for, as an import path within the module.

The list is closed on purpose. A reference that is not in it names something this build has no published image for, and failing beats guessing at a name that was never pushed. TestComponentsCoverTheManifests keeps it in step with the manifests, which is half of it: a new component also has to be published under the same repository and tag as the rest before a pre-built install can use it.

Functions

func ImageName

func ImageName(pkg string) string

ImageName is the image name pkg is published under: the last element of the import path, which is ko's --base-import-paths naming. ko lowercases it as well, which changes nothing while every package here already is.

func KoReference

func KoReference(pkg string) string

KoReference is the ko:// reference the manifests name pkg by.

ko resolves a manifest reference as written, so a "./"-relative import path works there too. Naming packages in full is this repository's convention rather than ko's rule, and only the full form maps to an image here: TestComponentsCoverTheManifests holds the convention, and a reference spelled any other way fails the install rather than resolving.

func RemoteDigest

func RemoteDigest(ctx context.Context, ref string) (string, error)

RemoteDigest asks ref's registry which manifest the tag names.

One HEAD request per image, needing only read access. A localhost registry is contacted over plain HTTP, which is what the Kind local registry serves.

Types

type Digester

type Digester func(ctx context.Context, ref string) (string, error)

Digester resolves a tagged image reference to the digest its tag currently names, in "sha256:..." form. Prebuilt takes one so tests can rewrite manifests without a registry.

type Prebuilt

type Prebuilt struct {
	// contains filtered or unexported fields
}

Prebuilt rewrites ko:// references to point at already-published images.

It is the drop-in counterpart to ko.Runner: same two methods, no builds, no registry writes, and no repository checkout beyond the manifests themselves. What it does need is read access to the registry, to pin each tag to a digest.

func NewPrebuilt

func NewPrebuilt(src Source, digest Digester) *Prebuilt

NewPrebuilt returns a resolver for an already-published image set. digest turns a tag into the image it names; callers outside tests pass RemoteDigest.

func (*Prebuilt) ResolveBytes

func (p *Prebuilt) ResolveBytes(ctx context.Context, manifest []byte) ([]byte, error)

ResolveBytes rewrites an in-memory manifest, such as kustomize output.

func (*Prebuilt) ResolvePath

func (p *Prebuilt) ResolvePath(ctx context.Context, path string) ([]byte, error)

ResolvePath rewrites the manifests a path covers.

type Source

type Source struct {
	// Repo is the registry path holding the component images, without a
	// trailing slash, e.g. "registry.example.com/substrate".
	Repo string
	// Tag is the tag every component image carries. Releases tag all
	// components together, so one tag covers the set.
	Tag string
}

Source describes where images come from.

The zero value builds and publishes them from source with ko. Setting Repo switches to images already published in a registry, and ko is never invoked.

func (Source) Describe

func (s Source) Describe() string

Describe renders the source for the install log.

func (Source) IsPrebuilt

func (s Source) IsPrebuilt() bool

IsPrebuilt reports whether images should be pulled rather than built.

func (Source) Validate

func (s Source) Validate() error

Validate checks a Source is usable before anything reaches the cluster.

Both halves are checked. A tag on its own would otherwise be discarded in silence, leaving a build from source that looks like the release the tag names.

Jump to

Keyboard shortcuts

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