Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Index ¶
- Constants
- func AddHostsConfiguration(ctx context.Context, fs afero.Fs, configPath string, ...) error
- type MockContainerdStore
- func (m *MockContainerdStore) All(ctx context.Context, ref Reference) ([]string, error)
- func (m *MockContainerdStore) Bytes(ctx context.Context, dgst digest.Digest) ([]byte, string, error)
- func (m *MockContainerdStore) List(ctx context.Context) ([]Reference, error)
- func (m *MockContainerdStore) Resolve(ctx context.Context, ref string) (digest.Digest, error)
- func (m *MockContainerdStore) Size(ctx context.Context, dgst digest.Digest) (int64, error)
- func (m *MockContainerdStore) Subscribe(ctx context.Context) (<-chan Reference, <-chan error)
- func (m *MockContainerdStore) Verify(ctx context.Context) error
- func (m *MockContainerdStore) Write(ctx context.Context, dst io.Writer, dgst digest.Digest) error
- type Reference
- type Registry
- type Store
Constants ¶
const ( // DefaultSock is the default containerd socket path. DefaultSock = "/run/containerd/containerd.sock" // DefaultNamespace is the default containerd namespace for this client. DefaultNamespace = "k8s.io" )
Variables ¶
This section is empty.
Functions ¶
func AddHostsConfiguration ¶
func AddHostsConfiguration(ctx context.Context, fs afero.Fs, configPath string, registryURLs, mirrorURLs []url.URL, resolveTags bool) error
AddHostsConfiguration adds mirror configuration to containerd for the specified URLs. Refer to containerd registry configuration documentation for mor information about required configuration. https://github.com/containerd/containerd/blob/main/docs/cri/config.md#registry-configuration https://github.com/containerd/containerd/blob/main/docs/hosts.md#registry-configuration---examples
Types ¶
type MockContainerdStore ¶
type MockContainerdStore struct {
// contains filtered or unexported fields
}
func NewMockContainerdStore ¶
func NewMockContainerdStore(validRefs []Reference) *MockContainerdStore
func (*MockContainerdStore) List ¶
func (m *MockContainerdStore) List(ctx context.Context) ([]Reference, error)
func (*MockContainerdStore) Subscribe ¶
func (m *MockContainerdStore) Subscribe(ctx context.Context) (<-chan Reference, <-chan error)
type Reference ¶
type Reference interface {
// Name is the name of the artifact.
Name() string
// Digest is the digest of the artifact.
Digest() digest.Digest
// Tag is the tag of the artifact.
Tag() string
// Repository is the repository of the artifact.
Repository() string
// Host is the host of the artifact.
Host() string
// String returns the string representation of the reference.
// docker.io/library/ubuntu:latest
// docker.io/library/ubuntu@sha256:abcdef
String() string
}
Reference is a reference to an OCI artifact in the content store.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a handler that handles requests to this registry.
func NewRegistry ¶
NewRegistry creates a new registry handler.
type Store ¶
type Store interface {
// Subscribe returns a channel of artifacts and a channel of errors.
// Artifacts are sent on the channel as they are discovered.
Subscribe(ctx context.Context) (<-chan Reference, <-chan error)
// List returns a list of artifacts.
List(ctx context.Context) ([]Reference, error)
// Resolve returns the digest for an existing artifact.
Resolve(ctx context.Context, ref string) (digest.Digest, error)
// Size returns the size of the artifact.
Size(ctx context.Context, dgst digest.Digest) (int64, error)
// Bytes returns the artifact bytes.
Bytes(ctx context.Context, dgst digest.Digest) ([]byte, string, error)
// Write writes the artifact bytes to the writer.
Write(ctx context.Context, dst io.Writer, dgst digest.Digest) error
// Verify will verify that the client status is healthy.
Verify(ctx context.Context) error
// All returns a list of digests of all resources referenced in ref.
All(ctx context.Context, ref Reference) ([]string, error)
}
Store is the interface for all containerd content store artifacts.
func NewDefaultStore ¶
NewDefaultStore creates a new Store with default values for containerd socket, namespace and hosts configuration path.