Documentation
¶
Overview ¶
Package ko builds and publishes images referenced by manifests, replacing the run_ko helper in the shell installer.
ko stays an external binary. It is pinned as a Go tool in hack/tools/ko and located the same way hack/run-tool.sh locates it, so ate-setup and the remaining shell scripts build with identical ko versions. Only `ko resolve` is ever invoked: the resolved manifest is applied through client-go, which removes the need for ko's kubectl delegation and the `-- --context=` special case that run_ko carried.
Index ¶
- func BuildVersion(root string) string
- type Runner
- func (r *Runner) Build(ctx context.Context, importPath string) (string, error)
- func (r *Runner) Resolve(ctx context.Context, path string, stdinManifest []byte) ([]byte, error)
- func (r *Runner) ResolveBytes(ctx context.Context, manifest []byte) ([]byte, error)
- func (r *Runner) ResolvePath(ctx context.Context, path string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildVersion ¶
BuildVersion mirrors the Makefile's VERSION: `git describe`, or "dev" when git has nothing to say. It is what ko stamps into the binaries.
Types ¶
type Runner ¶
type Runner struct {
// Root is the repository root; ko runs with this as its working directory.
Root string
// Env holds extra environment entries such as KO_DOCKER_REPO.
Env []string
// Stderr receives ko's build progress output.
Stderr *os.File
// contains filtered or unexported fields
}
Runner invokes ko with a fixed repository root and environment.
func New ¶
New returns a Runner, resolving the ko binary once up front so a missing tool fails before any cluster mutation happens.
func (*Runner) Build ¶
Build builds and publishes one Go binary's image and returns its pushed reference (the last line ko prints). Resolve covers everything a manifest references; Build is for the images with no manifest names, such as the ateom worker images a WorkerPool points at through workerImage.
func (*Runner) Resolve ¶
Resolve builds and publishes the images referenced by the manifest read from path (or from stdinManifest when path is "-") and returns the manifest with image references replaced by digests.
func (*Runner) ResolveBytes ¶
ResolveBytes resolves an in-memory manifest, such as kustomize output.