Documentation
¶
Overview ¶
Package image hosts the `kuke image` parent command and its subcommands: `load` (#200), `delete` (#212), and `prune` (#1036). Image *listing* moved to the `kuke get image` leaf in #824 — see `cmd/kuke/get/image`.
`kuke image *` is the canonical example of the "daemon-independent, in-process by design" command category captured in #217: every subcommand wraps containerd's image API directly. Whether `kukeond` is running has no effect on their semantics — they manipulate containerd content, not `/opt/kukeon/<realm>/` state — so they always construct a local in-process Client. `--no-daemon` is not accepted on these commands — the runtime ignore from #226 became a flag removal in #222.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDeleteCmd ¶
NewDeleteCmd builds the `kuke image delete` subcommand. The positional ref is required; not-found is surfaced with a friendly message that still unwraps to errdefs.ErrImageNotFound for callers using errors.Is.
func NewImageCmd ¶
NewImageCmd builds the `kuke image` parent command and registers its subcommands. Persistent flags on the root kuke command are inherited automatically.
func NewLoadCmd ¶
NewLoadCmd builds the `kuke image load` subcommand. Either a positional tarball path or `--from-docker <ref>` is required; passing both is a usage error.
func NewPruneCmd ¶ added in v0.6.0
NewPruneCmd builds the `kuke image prune` subcommand. It reclaims dangling image layers and the orphaned containerd leases pinning them in the realm's namespace, leaving tagged images and the snapshots backing live cells untouched. Idempotent: a second run on a clean realm is a no-op.
Types ¶
type Client ¶ added in v0.6.0
type Client interface {
io.Closer
LoadImage(ctx context.Context, realm string, tarball []byte) (kukeonv1.LoadImageResult, error)
DeleteImage(ctx context.Context, realm, ref string) (kukeonv1.DeleteImageResult, error)
PruneImages(ctx context.Context, realm string) (kukeonv1.PruneImagesResult, error)
}
Client is the narrow surface every `kuke image *` subcommand uses. It is satisfied by `*local.Client` (the in-process containerd-backed client) and by per-test fakes injected via MockControllerKey. There is no RPC implementation by design — see the package doc.
type MockControllerKey ¶
type MockControllerKey struct{}
MockControllerKey injects a mock Client via context for tests. Shared by every `kuke image *` subcommand so a single per-test fake can wire up load/get/delete behavior together.