Documentation ¶
Index ¶
- type ErrNoContentDigest
- type Registry
- func (r *Registry) IsImageCached(ctx context.Context, invocationImage string) (bool, error)
- func (r *Registry) ListTags(ctx context.Context, repository string) ([]string, error)
- func (r *Registry) PullBundle(ref cnab.OCIReference, insecureRegistry bool) (cnab.BundleReference, error)
- func (r *Registry) PushBundle(ctx context.Context, bundleRef cnab.BundleReference, insecureRegistry bool) (cnab.BundleReference, error)
- func (r *Registry) PushInvocationImage(ctx context.Context, invocationImage string) (digest.Digest, error)
- type RegistryProvider
- type TestRegistry
- func (t TestRegistry) IsImageCached(ctx context.Context, invocationImage string) (bool, error)
- func (t TestRegistry) ListTags(ctx context.Context, repository string) ([]string, error)
- func (t TestRegistry) PullBundle(ref cnab.OCIReference, insecureRegistry bool) (cnab.BundleReference, error)
- func (t TestRegistry) PushBundle(ctx context.Context, bundleRef cnab.BundleReference, insecureRegistry bool) (cnab.BundleReference, error)
- func (t TestRegistry) PushInvocationImage(ctx context.Context, invocationImage string) (digest.Digest, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrNoContentDigest ¶ added in v0.30.0
type ErrNoContentDigest error
ErrNoContentDigest represents an error due to an image not having a corresponding content digest in a bundle definition
func NewErrNoContentDigest ¶ added in v0.30.0
func NewErrNoContentDigest(image string) ErrNoContentDigest
NewErrNoContentDigest returns an ErrNoContentDigest formatted with the provided image name
type Registry ¶
type Registry struct {
*portercontext.Context
}
func NewRegistry ¶
func NewRegistry(c *portercontext.Context) *Registry
func (*Registry) IsImageCached ¶
func (*Registry) PullBundle ¶
func (r *Registry) PullBundle(ref cnab.OCIReference, insecureRegistry bool) (cnab.BundleReference, error)
PullBundle pulls a bundle from an OCI registry. Returns the bundle, and an optional image relocation mapping, if applicable.
func (*Registry) PushBundle ¶
func (r *Registry) PushBundle(ctx context.Context, bundleRef cnab.BundleReference, insecureRegistry bool) (cnab.BundleReference, error)
func (*Registry) PushInvocationImage ¶
func (r *Registry) PushInvocationImage(ctx context.Context, invocationImage string) (digest.Digest, error)
PushInvocationImage pushes the invocation image from the Docker image cache to the specified location the expected format of the invocationImage is REGISTRY/NAME:TAG. Returns the image digest from the registry.
type RegistryProvider ¶
type RegistryProvider interface { // PullBundle pulls a bundle from an OCI registry. PullBundle(ref cnab.OCIReference, insecureRegistry bool) (cnab.BundleReference, error) // PushBundle pushes a bundle to an OCI registry. PushBundle(ctx context.Context, bundleRef cnab.BundleReference, insecureRegistry bool) (cnab.BundleReference, error) // PushInvocationImage pushes the invocation image from the Docker image cache to the specified location // the expected format of the invocationImage is REGISTRY/NAME:TAG. // Returns the image digest from the registry. PushInvocationImage(ctx context.Context, invocationImage string) (digest.Digest, error) // IsImageCached checks whether a particular invocation image exists in the local image cache. IsImageCached(ctx context.Context, invocationImage string) (bool, error) // ListTags returns all tags defined on the specified repository. ListTags(ctx context.Context, repository string) ([]string, error) }
RegistryProvider handles talking with an OCI registry.
type TestRegistry ¶
type TestRegistry struct { MockPullBundle func(ref cnab.OCIReference, insecureRegistry bool) (cnab.BundleReference, error) MockPushBundle func(bundleRef cnab.BundleReference, insecureRegistry bool) (bundleReference cnab.BundleReference, err error) MockPushInvocationImage func(ctx context.Context, invocationImage string) (imageDigest digest.Digest, err error) MockIsImageCached func(ctx context.Context, invocationImage string) (bool, error) MockListTags func(ctx context.Context, repository string) ([]string, error) }
func NewTestRegistry ¶
func NewTestRegistry() *TestRegistry
func (TestRegistry) IsImageCached ¶
func (TestRegistry) PullBundle ¶
func (t TestRegistry) PullBundle(ref cnab.OCIReference, insecureRegistry bool) (cnab.BundleReference, error)
func (TestRegistry) PushBundle ¶
func (t TestRegistry) PushBundle(ctx context.Context, bundleRef cnab.BundleReference, insecureRegistry bool) (cnab.BundleReference, error)
func (TestRegistry) PushInvocationImage ¶
func (t TestRegistry) PushInvocationImage(ctx context.Context, invocationImage string) (digest.Digest, error)
Click to show internal directories.
Click to hide internal directories.