ko

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: 7 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildVersion

func BuildVersion(root string) string

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

func New(root string, env []string) (*Runner, error)

New returns a Runner, resolving the ko binary once up front so a missing tool fails before any cluster mutation happens.

func (*Runner) Build

func (r *Runner) Build(ctx context.Context, importPath string) (string, error)

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

func (r *Runner) Resolve(ctx context.Context, path string, stdinManifest []byte) ([]byte, error)

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

func (r *Runner) ResolveBytes(ctx context.Context, manifest []byte) ([]byte, error)

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

func (*Runner) ResolvePath

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

ResolvePath resolves a manifest file or directory.

Jump to

Keyboard shortcuts

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