registry

package
v0.0.0-...-9284219 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GlobalPullSecretUser     = "global-pull-secret-user"
	GlobalPullSecretPassword = "global-pull-secret-password"
	GlobalRepo               = "global-repo"
	LocalPullSecretUser1     = "local-secret-user-1"
	LocalPullSecretPassword1 = "local-secret-password-1"
	User1Repo                = "user-1-repo"
	LocalPullSecretUser2     = "local-secret-user-2"
	LocalPullSecretPassword2 = "local-secret-password-2"
	User2Repo                = "user-2-repo"
	CommonRepo               = "common-repo"
	PublicRepo               = "public-repo"
)

Variables

This section is empty.

Functions

func ComputeNameByMediaType

func ComputeNameByMediaType(mediaType string, suffixes ...string) string

ComputeNameByMediaType returns the name of the image given the media type. The name of the image is given by the media type, replacing the "." with "-" and removing the "+...." suffix and "application/" prefix. The tag is given by the indices of the for loops.

func GetCertPath

func GetCertPath() string

func PushMockImage

func PushMockImage(ctx context.Context, newImage *MockImage) error

func RunRegistry

func RunRegistry(ctx context.Context, registryChan chan error) (string, []byte, error)

RunRegistry starts a registry server in a goroutine and returns the url and the caCertBytes It is the only one function that should be called from outside this package to instantiate a registry server

func SeedMockRegistry

func SeedMockRegistry(ctx context.Context) (err error)

func SetCertPath

func SetCertPath(path string)

Types

type MockImage

type MockImage struct {
	Architectures sets.Set[string]
	MediaType     string
	Repository    string
	Name          string
	Tag           string
	Labels        map[string]string
	// contains filtered or unexported fields
}

MockImage is a mock image that can be pushed to a registry. It carries only the information needed for the tests. The final image is either a single architecture image or a manifest list and has no data in the layers. The methods of the MockImage should not be considered for production use and are only meant to facilitate the tests of this operator.

func GetMockImages

func GetMockImages() []MockImage

GetMockImages returns a list of mock images. In particular, it generates a list of images for each MediaType and available repository. For List types, it generates both a list of images with multiple architectures and a list of images with a single architecture.

func (*MockImage) Equals

func (i *MockImage) Equals(other *MockImage) bool

func (*MockImage) GetUrl

func (i *MockImage) GetUrl() string

GetUrl returns the url of the image

Directories

Path Synopsis
auth
htpasswd
Package htpasswd provides a simple authentication scheme that checks for the user credential hash in an htpasswd formatted file in a configuration-determined location.
Package htpasswd provides a simple authentication scheme that checks for the user credential hash in an htpasswd formatted file in a configuration-determined location.

Jump to

Keyboard shortcuts

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