registry

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Address() string
	Push(ctx context.Context, imageName, tag, ociTarPath string) error
	IsLocal() bool
}

Registry manages an OCI registry for staging local base images.

func NewRegistry

func NewRegistry(dataDir string, registryConfig *model.RegistryConfig) (Registry, error)

NewRegistry creates a Registry based on the environment. In CI (CI env var set), it returns a remote registry passthrough. The registry address is resolved with the following precedence:

  1. CONTAINER_HIVE_REGISTRY env var
  2. registry.address from hive.yml (passed via registryConfig)

Otherwise, it returns an embedded zot registry for local builds. The dataDir parameter sets persistent storage for the local registry; if empty, a temporary directory is used.

type RemoteRegistry

type RemoteRegistry struct {
	// contains filtered or unexported fields
}

RemoteRegistry is a passthrough registry for CI environments. Start and Stop are no-ops; Push pushes to the configured remote registry.

func NewRemoteRegistry

func NewRemoteRegistry(address string) *RemoteRegistry

NewRemoteRegistry creates a remote registry with the given address.

func (*RemoteRegistry) Address

func (r *RemoteRegistry) Address() string

func (*RemoteRegistry) IsLocal

func (r *RemoteRegistry) IsLocal() bool

func (*RemoteRegistry) Push

func (r *RemoteRegistry) Push(_ context.Context, imageName, tag, ociTarPath string) error

func (*RemoteRegistry) Start

func (r *RemoteRegistry) Start(_ context.Context) error

func (*RemoteRegistry) Stop

func (r *RemoteRegistry) Stop(_ context.Context) error

type ZotRegistry

type ZotRegistry struct {
	// contains filtered or unexported fields
}

ZotRegistry is an embedded OCI registry for local development builds. It runs zot in-process on a random port.

func NewZotRegistry

func NewZotRegistry(dataDir string) *ZotRegistry

NewZotRegistry creates a new ZotRegistry instance. If dataDir is non-empty, it is used as persistent storage (created if needed). Otherwise a temporary directory is used and cleaned up on Stop.

func (*ZotRegistry) Address

func (z *ZotRegistry) Address() string

func (*ZotRegistry) IsLocal

func (z *ZotRegistry) IsLocal() bool

func (*ZotRegistry) Push

func (z *ZotRegistry) Push(_ context.Context, imageName, tag, ociTarPath string) error

func (*ZotRegistry) Start

func (z *ZotRegistry) Start(ctx context.Context) error

func (*ZotRegistry) Stop

func (z *ZotRegistry) Stop(_ context.Context) error

Jump to

Keyboard shortcuts

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