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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
ResolveBytes rewrites an in-memory manifest, such as kustomize output.
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) IsPrebuilt ¶
IsPrebuilt reports whether images should be pulled rather than built.