Documentation
¶
Overview ¶
Package imagepull discloses the container images a command is about to download, estimates their size from the registry without pulling, and enforces the offline mode that lets a user on a metered connection skip every pull and rebuild that is not strictly required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DryRun ¶
func DryRun() bool
DryRun reports whether the command should report what it would download and stop before downloading it.
func Note ¶
Note renders a size for appending to a one-line pull announcement. Empty when the registry did not answer, so the line reads normally without it.
func Offline ¶
func Offline() bool
Offline reports whether lerd should skip pulls and rebuilds unless the image is missing outright.
func SetOffline ¶
func SetOffline(v bool)
SetOffline records the --no-pull flag. LERD_OFFLINE sets the same mode for callers that never parse flags (the daemon, the watcher, the MCP server).
func Size ¶
Size returns the compressed download size of ref in bytes, read from the registry manifest without pulling anything. ok is false for a locally built image and whenever the registry cannot be reached or understood, in which case callers disclose the pull without a number rather than failing.
Types ¶
type Item ¶
type Item struct {
Name string // what the user recognises; falls back to Ref when empty
Ref string // registry reference to size up; empty for a pure local build
Reason string // why this download is happening
Build bool // a local build, which downloads its base image
Bytes int64 // estimated download size, 0 when unknown
}
Item is one image a command is about to download or build.
type Plan ¶
type Plan []Item
Plan is everything a single command will download, disclosed in one block before the first byte moves.
func (Plan) Fill ¶
Fill looks up the download size of every item, concurrently. Items whose size cannot be read keep a zero and are disclosed without a number.