Expand description
Manages caproni’s host-side pull-through zot registry. Owns the zot
binary lifecycle (start on caproni up, stop on the last
caproni destroy), config templating, and the flock-protected ref
counting that lets multiple profiles share a single zot instance.
Ported from internal/registrycache/registrycache.go.
Re-exports§
pub use config::ConfigError;pub use paths::PathError;
Modules§
- config
- Zot config templating.
- lock
- Cross-process serialization for registry-cache state mutations.
- paths
- Filesystem layout for the host-side registry cache.
- process
- zot process lifecycle: spawn, liveness check, and graceful stop.
- refs
- Per-profile ref counting for the host-side registry cache.
Structs§
- Endpoint
- Describes the running zot from the cluster’s perspective. Each
driver composes its own mirror URL by calling
Endpoint::host_portwith the host name resolvable from inside its own cluster (colima useshost.docker.internal, k3d useshost.k3d.internal). - State
- Captures the result of
status. Powerscaproni registry status.
Enums§
- Registry
Cache Error - Errors from registry-cache orchestration.
Constants§
- DEFAULT_
PORT - The port zot listens on. Caproni picks a non-default to avoid
collisions with macOS
AirPlay(which binds 5000). Exported so drivers can compose their own mirror URL alongside their preferred host name; seeEndpointand each driver’s mirror-wiring code.
Functions§
- ensure
- Starts the host-side zot if not running, registers the given profile’s ref, regenerates the config, and returns the endpoint drivers should configure as a mirror. Idempotent. Concurrency-safe: holds an exclusive flock for the duration.
- ensure_
stopped_ for_ profile - Releases the profile’s hold on the host-side registry cache. The
cache process itself is left running so the next
caproni up(for this or any profile) starts warm. Usestopto explicitly tear down zot. Concurrency-safe. - start
- Spawns the host-side zot process using the previously persisted
config at
paths::config_path. ReturnsOk(())immediately if zot is already running. Does not touch refs – this is a process-level operation, not a profile lifecycle event. - status
- Reports the current state. Read-only; safe to call without the lock (concurrent mutations are short and will momentarily disagree).
- stop
- Stops the host-side zot process. Refs are preserved (callers that
still expect the cache running can notice via
status). Cached data on disk is preserved so the nextensurerestarts warm. Concurrency-safe.