Documentation
¶
Overview ¶
Package registrytest provides utilities for testing with OCI registries.
Index ¶
- func NewServer(t *testing.T) *httptest.Server
- func NewServerWithAuth(t *testing.T, user, password string) *httptest.Server
- func PushImage(t *testing.T, registryHost, repo, tag string, img v1.Image, ...) (name.Reference, v1.Descriptor)
- func PushLegacyAttestation(t *testing.T, registryHost, repo string, subjectDigest v1.Hash, img v1.Image, ...)
- func PushRandomImage(t *testing.T, registryHost, repo, tag string, opts ...remote.Option) (name.Reference, v1.Descriptor)
- func PushReferrer(t *testing.T, registryHost, repo string, subjectDesc v1.Descriptor, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServerWithAuth ¶ added in v0.73.0
NewServerWithAuth starts a test registry server with OCI 1.1 referrers support that requires the given credentials via HTTP basic auth.
func PushImage ¶ added in v0.73.0
func PushImage(t *testing.T, registryHost, repo, tag string, img v1.Image, opts ...remote.Option) (name.Reference, v1.Descriptor)
PushImage pushes the given image to the registry and returns its reference and descriptor.
func PushLegacyAttestation ¶ added in v0.73.0
func PushLegacyAttestation(t *testing.T, registryHost, repo string, subjectDigest v1.Hash, img v1.Image, opts ...remote.Option)
PushLegacyAttestation pushes an image as a legacy cosign `.att` attestation for the given subject digest (the `<algorithm>-<hex>.att` tag convention).
func PushRandomImage ¶
func PushRandomImage(t *testing.T, registryHost, repo, tag string, opts ...remote.Option) (name.Reference, v1.Descriptor)
PushRandomImage pushes a random image to the registry and returns its reference and descriptor.
func PushReferrer ¶
func PushReferrer(t *testing.T, registryHost, repo string, subjectDesc v1.Descriptor, artifactType string, content []byte, opts ...remote.Option)
PushReferrer pushes an artifact referrer to the registry attached to the subject image. The artifactType is used both as the config media type (for OCI 1.1 artifact type) and layer media type.
Types ¶
This section is empty.