Help us shape the future of Go! Take the 2026 Go Developer Survey

imageregistry

package
v0.15.0 Latest Latest
Warning

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

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

Documentation

Overview

Package imageregistry is the install's image registry: where a build is pushed when the runtime pulls rather than imports (issue #72, PR 5, docs/design/notes-image-registry-issue-72.md).

The registry is an adapter (R-252, issue #153; adapter/api/imageregistry.go) and this package is how core uses it. Like source connections, a stored registry adapter is built from its row each time it is used, never cached: a password rotated on one replica is what every replica pushes with next, with no restart and nothing to watch. One declared in the startup configuration — the config file, or PANDO_REGISTRY_* — is built once at startup and is read-only (R-271).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigStore

type ConfigStore interface {
	List(ctx context.Context) ([]state.AdapterConfig, error)
}

ConfigStore lists stored adapters (state.Adapters).

type CredentialStore

type CredentialStore interface {
	Resolve(ctx context.Context, adapterID string) (map[string]secret.Value, error)
}

CredentialStore opens an adapter's sealed credentials (state.AdapterCredentials).

type Declared

type Declared struct {
	ID        string
	Adapter   api.ImageRegistryAdapter
	IsDefault bool
}

Declared is a registry adapter the startup configuration declares, already configured.

type Provider

type Provider interface {
	Current(ctx context.Context) (*Registry, error)
}

Provider answers the registry in effect now. *Service is one; Static is one that never changes.

func Static

func Static(r *Registry) Provider

Static is a Provider that always answers r.

type Registry

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

Registry is the install's registry adapter, as core uses it. A nil *Registry is "none configured", and every method answers accordingly.

func Of

Of is the Registry for a configured adapter.

func (*Registry) Always

func (r *Registry) Always() bool

Always reports whether builds go through the registry even for a runtime that can import them.

func (*Registry) Auth

func (r *Registry) Auth(ctx context.Context) (*api.RegistryAuth, error)

Auth is the credential for one push or pull. Nil for anonymous.

func (*Registry) Configured

func (r *Registry) Configured() bool

Configured reports whether the install has a registry.

func (*Registry) DeleteApp

func (r *Registry) DeleteApp(ctx context.Context, appID string, workloads []string) (int, error)

DeleteApp deletes every manifest of a deleted app's builds (R-224).

func (*Registry) Host

func (r *Registry) Host() string

Host is the registry's host and port, for messages.

func (*Registry) ID

func (r *Registry) ID() string

ID is the adapter's ID.

func (*Registry) Owns

func (r *Registry) Owns(ref string) bool

Owns reports whether an image reference is a build Pando pushed there.

func (*Registry) Target

func (r *Registry) Target(ctx context.Context, appID, workload, deploymentID string) (*api.PushTarget, error)

Target is where one build is pushed, with the credential for it.

type Service

type Service struct {
	Configs     ConfigStore
	Credentials CredentialStore

	// New returns an unconfigured adapter of a kind, or nil.
	New func(kind string) api.ImageRegistryAdapter

	// Declared are the registries the startup configuration declares. A row
	// in adapter_configs with the same ID is overridden by it.
	Declared []Declared
}

Service builds the install's image registry adapter.

func (*Service) Adapter

func (s *Service) Adapter(ctx context.Context, id string) (api.ImageRegistryAdapter, error)

Adapter builds one registry adapter by ID, declared or stored, for the adapters screen's health and capabilities.

func (*Service) Current

func (s *Service) Current(ctx context.Context) (*Registry, error)

Current is the registry in effect now: nil when none is configured. One that cannot be built is an error that says why, never "none": a registry the operator configured and Pando silently ignored would send builds nowhere.

func (*Service) CurrentRegistry

func (s *Service) CurrentRegistry(ctx context.Context) (planner.InstallRegistry, error)

CurrentRegistry is Current as the planner asks it (planner.InstallRegistries). The planner cannot name this package's type: state imports the planner.

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, id, kind string, config json.RawMessage, given map[string]secret.Value) error

Validate configures a registry as it would be saved — config and the credentials given, beside the ones already stored for id that are not replaced — and returns the adapter's refusal, if it has one, so a registry Pando cannot use is refused when it is saved rather than by every deploy after. A credential sent empty removes the stored one, as saving does.

Jump to

Keyboard shortcuts

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