registrykit

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package registrykit is what the image registry adapters share: reading a registry address, laying built images out in it, and deleting a deleted app's (R-224). Every registry Pando pushes to speaks the OCI distribution API; what differs between providers is how Pando signs in and whether a repository has to exist before a push, and each kind supplies those.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlwaysField

func AlwaysField() api.Field

AlwaysField sends every build through the registry.

func URLField

func URLField(placeholder, help string) api.Field

URLField is the registry's address.

func Warnings added in v0.10.0

func Warnings(raw json.RawMessage) []string

Warnings says what in an OCI registry's settings is accepted but will not do what the operator likely expects. Shown when the settings are saved; nothing here refuses them, Open does that.

Types

type AuthFunc

type AuthFunc func(ctx context.Context, host string) (*api.RegistryAuth, error)

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

type Layout

type Layout string

Layout is how built images are arranged in the registry.

const (
	// LayoutPerApp is <prefix>/apps/<app>[/<workload>], tagged with the
	// deployment: one repository per workload, and per app, so a deleted app's
	// images are a few listings to delete. The default where the registry
	// creates repositories on push.
	LayoutPerApp Layout = "per_app"

	// LayoutSingle puts every image in <prefix>, tagged
	// <app>-<workload>-<deployment>, for a registry where a repository must
	// exist before a push (ECR).
	LayoutSingle Layout = "single"
)

type Registry

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

Registry is a configured registry. Each kind embeds one and adds Kind, Configure and Info.

func Open

func Open(s Settings, createsOnPush bool, auth AuthFunc) (Registry, error)

Open reads the shared settings. createsOnPush is the provider's answer to whether a push creates its repository; where it does not, the layout is single and a per_app one is refused here rather than at the first push.

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 through the registry API (R-224).

func (*Registry) Health added in v0.10.0

func (r *Registry) Health(ctx context.Context) ([]string, error)

Health is HealthCheck with what works but will not do what the operator expects: a credential that may push and pull but not delete, so a deleted app's images stay in the registry (R-224). Notes never fail the check; pushing and pulling, which deploys need, still work.

func (*Registry) HealthCheck

func (r *Registry) HealthCheck(ctx context.Context) error

HealthCheck signs in to the registry's API, so a registry Pando cannot reach or whose credential it refuses is reported on the adapters screen rather than by the first deploy that needs it. A missing delete permission is not a failure here; Health reports it as a note.

func (*Registry) Host

func (r *Registry) Host() string

Host is the registry's host and port.

func (*Registry) ImageRegistryCapabilities

func (r *Registry) ImageRegistryCapabilities() api.ImageRegistryCapabilities

Capabilities is the shared half of the kind's capabilities.

func (*Registry) Owns

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

Owns reports whether an image reference is in this registry, under Pando's prefix: a built image Pando pushed.

func (*Registry) PullAuth

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

PullAuth is the credential for one push or pull, minted fresh by the kind where its provider issues short-lived passwords. Nil for anonymous.

func (*Registry) Repository

func (r *Registry) Repository(appID, workload, deploymentID string) (repository, tag string)

Repository is where an app's workload's builds go, and the tag a deployment is pushed under. An empty workload is the app-wide image.

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 Settings

type Settings struct {
	// URL is the registry and an optional path prefix:
	// https://registry.internal:5000, or
	// 123456789012.dkr.ecr.us-east-1.amazonaws.com/pando.
	URL string `json:"url"`

	// Layout is per_app or single. Empty is the kind's default.
	Layout string `json:"layout"`

	// Insecure permits plain HTTP. Off unless the operator sets it (O-35).
	Insecure bool `json:"insecure"`

	// Always sends builds through the registry even when the runtime can
	// take them directly. Off by default: single-host Docker imports (O-34).
	Always bool `json:"always"`

	// PackagesAPI is the GitHub REST API a deleted app's images are deleted
	// through, for a registry that is GitHub Container Registry. Set for
	// ghcr.io when empty; a test sets it to treat its own registry as GHCR.
	PackagesAPI string `json:"-"`

	// DeleteRemedy is what a provider's credential needs to delete images,
	// said when the health check finds it cannot. Empty gives the advice for
	// a registry Pando runs or one with delete permissions to grant.
	DeleteRemedy string `json:"-"`
}

Settings are the settings every kind shares, as stored in adapter_configs.config.

Jump to

Keyboard shortcuts

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