chartstamptest

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package chartstamptest serves the part of the OCI distribution API that a push and a helm pull use, so a test can run both against the bytes they would write to a real registry, with no daemon and no network. Like a public GHCR package, it reads for anyone and writes only for the credential it was given.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackagedChart

func PackagedChart(t *testing.T, version string) []byte

PackagedChart is a chart package of the shape the packager writes, small enough for a test that does not read what is in it.

Types

type Registry

type Registry struct {

	// Username and Password, when set, are what a write has to present.
	Username, Password string
	// Private makes every read need that credential too, as a package does on
	// GHCR until someone makes it public.
	Private bool
	// contains filtered or unexported fields
}

Registry is an in-memory OCI registry.

func NewRegistry

func NewRegistry(t *testing.T) *Registry

NewRegistry starts a registry for the length of a test.

func (*Registry) Blobs

func (r *Registry) Blobs() int

Blobs is how many blobs the registry holds, which a test reads to show a refused push wrote nothing.

func (*Registry) Host

func (r *Registry) Host() string

Host is the registry's host:port, plain HTTP.

func (*Registry) Tags

func (r *Registry) Tags(repository string) []string

Tags is what the repository's tags are, without the digests it also stores manifests under.

Jump to

Keyboard shortcuts

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