registry

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package registry holds the adapter that lists a container image repository's tags over the Docker Registry HTTP API v2, so burrowd can see which versions exist and compute what auto-deploy would take (ADR-0052). It is OUTBOUND-only and used only for the optional auto-deploy read/watch — never on the core deploy path, which stays independent of registry reachability (ADR-0040).

Known gap: registries that require a non-standard auth scheme — notably AWS ECR, which signs requests with SigV4 — are out of scope. The standard v2 Bearer-token flow implemented here covers GHCR (the reference registry, ADR-0046), Docker Hub, DigitalOcean's registry, and the Google/Artifact-Registry token endpoints. An unsupported registry surfaces an informative error rather than failing the caller's whole path.

Index

Constants

This section is empty.

Variables

View Source
var ErrTagsUnavailable = errors.New("registry: tags API unavailable")

ErrTagsUnavailable reports that the endpoint does not serve a usable v2 tags API (e.g. a 404 or an unexpected body) — the repository is absent or the host is not a v2 registry. Callers use errors.Is to distinguish it from a transient failure.

Functions

This section is empty.

Types

type Client added in v0.13.0

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

Client lists an image repository's tags over the Docker Registry HTTP API v2. The caller injects an *http.Client with a bounded timeout so tests are deterministic and a poll never hangs on an unresponsive registry.

func NewClient added in v0.13.0

func NewClient(hc *http.Client) *Client

NewClient returns a Client using hc (defaulting to http.DefaultClient). The caller is expected to pass an *http.Client with a bounded timeout.

func (*Client) ListTags added in v0.13.0

func (c *Client) ListTags(ctx context.Context, imageRef string, auth controlplane.RegistryAuth) ([]string, error)

ListTags returns the tags of the repository named by imageRef, following v2 tag-list pagination (the Link header) and the standard Bearer-token auth flow. auth carries optional basic-auth credentials for a private repo; the zero value lists anonymously (public GHCR/Docker Hub/DO and the token-auth cloud registries). A 429 surfaces as *RateLimitError; a host that does not serve a usable tags API surfaces as ErrTagsUnavailable.

type RateLimitError added in v0.13.0

type RateLimitError struct {
	RetryAfter string
}

RateLimitError reports a registry 429, carrying the raw Retry-After value the registry returned (seconds or an HTTP date, empty if none) so a caller can back off honoring it (ADR-0052 §7).

func (*RateLimitError) Error added in v0.13.0

func (e *RateLimitError) Error() string

func (*RateLimitError) RetryAfterHint added in v0.13.0

func (e *RateLimitError) RetryAfterHint() string

RetryAfterHint returns the raw Retry-After value the registry returned (seconds or an HTTP date, empty if none). It satisfies the controlplane's rate-limit hint interface so the auto-deploy poller can back off honoring the registry's pushback (ADR-0052 §7) without importing this adapter (which would cycle: this package imports controlplane).

Jump to

Keyboard shortcuts

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