ocitest

package
v0.26.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeClient

type FakeClient struct {
	WantTags map[string][]string
	WantErr  error

	ListTagCalls []string
	// contains filtered or unexported fields
}

func (*FakeClient) Image

func (f *FakeClient) Image(tag string, opts ...oci.Option) (v1.Image, error)

func (*FakeClient) ListTags

func (f *FakeClient) ListTags(repoName string, opts ...oci.Option) ([]string, error)

type FakeImage

type FakeImage struct{}

func (*FakeImage) ConfigFile

func (f *FakeImage) ConfigFile() (*v1.ConfigFile, error)

func (*FakeImage) ConfigName

func (f *FakeImage) ConfigName() (v1.Hash, error)

func (*FakeImage) Digest

func (f *FakeImage) Digest() (v1.Hash, error)

func (*FakeImage) LayerByDiffID

func (f *FakeImage) LayerByDiffID(v1.Hash) (v1.Layer, error)

func (*FakeImage) LayerByDigest

func (f *FakeImage) LayerByDigest(v1.Hash) (v1.Layer, error)

func (*FakeImage) Layers

func (f *FakeImage) Layers() ([]v1.Layer, error)

func (*FakeImage) Manifest

func (f *FakeImage) Manifest() (*v1.Manifest, error)

func (*FakeImage) MediaType

func (f *FakeImage) MediaType() (types.MediaType, error)

func (*FakeImage) RawConfigFile

func (f *FakeImage) RawConfigFile() ([]byte, error)

func (*FakeImage) RawManifest

func (f *FakeImage) RawManifest() ([]byte, error)

func (*FakeImage) Size

func (f *FakeImage) Size() (int64, error)

type Registry

type Registry struct {
	*ocimem.Registry
	// contains filtered or unexported fields
}

func NewTLSRegistry

func NewTLSRegistry(private bool, cloudProviderID cloud.ProviderID) (*Registry, error)

Creates an OCI registry to test tls/https.

Note: Container libs use Docker under the hood to handle OCI and Docker defaults to HTTP when it detects that the registry host is localhost or 127.0.0.1. In order to test OCI with a HTTPS server, we have to supply a "fake" host. We use a mock dns server to create an A record which binds navecd.io to 127.0.0.1. All OCI tests have to use navecd.io as host.

func StartCUERegistry

func StartCUERegistry(
	registryPath string,
) (*Registry, error)

func (*Registry) Addr

func (r *Registry) Addr() string

func (*Registry) CUERegistryClient

func (r *Registry) CUERegistryClient() *modregistry.Client

func (*Registry) Client

func (r *Registry) Client() *http.Client

func (*Registry) Close

func (r *Registry) Close()

func (*Registry) URL

func (r *Registry) URL() string

Jump to

Keyboard shortcuts

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