-
Notifications
You must be signed in to change notification settings - Fork 239
/
registry.go
31 lines (24 loc) · 1.28 KB
/
registry.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package image
import (
"context"
)
// Registry knows how to Pull and Unpack Operator Bundle images to the filesystem.
// Note: In the future, Registry will know how to Build and Push Operator Bundle images as well.
type Registry interface {
// Pull fetches and stores an image by reference.
Pull(ctx context.Context, ref Reference) error
// Push uploads an image to the remote registry of its reference.
// If the referenced image does not exist in the registry, an error is returned.
// Push(ctx context.Context, ref string) error
// Unpack writes the unpackaged content of an image to a directory.
// If the referenced image does not exist in the registry, an error is returned.
Unpack(ctx context.Context, ref Reference, dir string) error
// Labels gets the labels for an image that is already stored.
Labels(ctx context.Context, ref Reference) (map[string]string, error)
// Destroy cleans up any on-disk resources used to track images
Destroy() error
// Pack creates and stores an image based on the given reference and returns a reference to the new image.
// If the referenced image does not exist in the registry, a new image is created from scratch.
// If it exists, it's used as the base image.
// Pack(ctx context.Context, ref Reference, from io.Reader) (next string, err error)
}