Hyper.Img.OciLoader.Umoci (Hyper v0.1.0)

Copy Markdown View Source

Resolves and (when not operator-provided) installs the umoci binary that Hyper.Img.OciLoader uses to flatten OCI image layers.

Two sources, in priority order (mirrors Hyper.Node.Vmlinux):

  1. An operator-configured path via [tools] umoci in /etc/hyper/config.toml (Hyper.Cfg.Tools.umoci/0). If set, it wins and is never downloaded.
  2. Otherwise the pinned static binary downloaded by ensure_installed/0 into Hyper.Cfg.Dirs.umoci_install_dir/0 (<work_dir>/redist/umoci).

Summary

Functions

Absolute path to the umoci binary: the operator-configured path if set, otherwise the downloaded default for this node's architecture. Raises if the architecture is unsupported.

Ensure a usable umoci is available on this node. A no-op when the operator configured umoci_path (they own it); otherwise downloads the pinned static binary for this node's architecture into the redist cache if it is not already present and executable, then marks it executable. Idempotent.

Functions

bin()

@spec bin() :: Path.t()

Absolute path to the umoci binary: the operator-configured path if set, otherwise the downloaded default for this node's architecture. Raises if the architecture is unsupported.

ensure_installed()

@spec ensure_installed() :: :ok | {:error, term()}

Ensure a usable umoci is available on this node. A no-op when the operator configured umoci_path (they own it); otherwise downloads the pinned static binary for this node's architecture into the redist cache if it is not already present and executable, then marks it executable. Idempotent.