Documentation
¶
Overview ¶
Package images transfers CLI-managed OCI images between registries, local storage, and object storage.
Index ¶
- func CacheRoot() (string, error)
- func CacheSize(source, cacheRoot string) (int64, error)
- func Mirror(ctx context.Context, source, cacheRoot string, objects ObjectStore, ...) (string, error)
- func Mirrored(ctx context.Context, source, digest string, objects ObjectStore) (string, bool, error)
- func ParseSource(source string) (name.Tag, error)
- func PublishMirrorIndex(ctx context.Context, source, cacheRoot string, objects ObjectStore) (string, error)
- func Pull(ctx context.Context, source string, cacheRoot string, progress tui.Progress) error
- func PullIfMissing(ctx context.Context, source, digest, cacheRoot string, progress tui.Progress) error
- func Push(ctx context.Context, source, destination, cacheRoot string, refresh bool, ...) (string, error)
- func ResolveDigest(ctx context.Context, source string) (string, error)
- func UploadSize(source, cacheRoot string) (int64, error)
- type ObjectStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheSize ¶ added in v0.2.0
CacheSize returns the total content bytes stored for source in the local OCI cache.
func Mirror ¶
func Mirror(ctx context.Context, source, cacheRoot string, objects ObjectStore, progress tui.Progress) (string, error)
Mirror publishes a cached image beneath the setup-managed mirror namespace.
func Mirrored ¶ added in v0.2.0
func Mirrored(ctx context.Context, source, digest string, objects ObjectStore) (string, bool, error)
Mirrored reports whether the expected source digest is already published in the cluster mirror.
func ParseSource ¶
ParseSource parses a tagged source reference.
func PublishMirrorIndex ¶ added in v0.2.1
func PublishMirrorIndex(ctx context.Context, source, cacheRoot string, objects ObjectStore) (string, error)
PublishMirrorIndex repairs mirror metadata from a complete local cache without uploading immutable blobs again.
func PullIfMissing ¶ added in v0.2.0
func PullIfMissing(ctx context.Context, source, digest, cacheRoot string, progress tui.Progress) error
PullIfMissing imports source unless the requested digest is cached and valid.
func Push ¶
func Push(ctx context.Context, source, destination, cacheRoot string, refresh bool, objects ObjectStore, progress tui.Progress) (string, error)
Push uploads a cached OCI repository with immutable objects first and returns the normalized cluster image reference.
func ResolveDigest ¶ added in v0.2.0
ResolveDigest returns the current digest of a remote image reference.
func UploadSize ¶ added in v0.2.0
UploadSize returns the bytes uploaded for source's cached OCI repository.
Types ¶
type ObjectStore ¶
type ObjectStore interface {
Get(context.Context, string) ([]byte, string, error)
PutStream(context.Context, string, io.Reader, int64) error
PutIfMatch(context.Context, string, []byte, string) error
}
ObjectStore is the object-storage contract required by image publication. Get returns an opaque version used to replace mutable index.json objects.