Documentation
¶
Overview ¶
Package registry mocks an OCI distribution registry the way a release's artifacts are probed: HEAD and GET of /v2/<name>/manifests/<reference> for images and for charts (names under charts/). The harness runs one instance as the public registry and one as the private registry, so a scenario can give them different states.
Manifest routes have defaults a fixture rarely needs to spell out: a 200 without a body is a minimal manifest with its Docker-Content-Digest, a 404 without a body is the registry's MANIFEST_UNKNOWN error, and a manifest no route scripts is MANIFEST_UNKNOWN too. With the stale-login flag set every request is answered 401 UNAUTHORIZED with a bearer challenge, the answer a registry gives a client whose stored login has expired.
Index ¶
Constants ¶
const ( ManifestMediaType = "application/vnd.oci.image.manifest.v1+json" ImageConfigMediaType = "application/vnd.oci.image.config.v1+json" ChartConfigMediaType = "application/vnd.cncf.helm.config.v1+json" )
Media types of the default manifest.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
Server is a running mock.
func Start ¶
Start serves the routes on a loopback port until Close. With staleLogin every request is refused with 401 UNAUTHORIZED.