cnabtooci

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseOCIReference

func ParseOCIReference(ociRef string) (reference.Named, error)

Types

type Registry

type Registry struct {
	*portercontext.Context
}

func NewRegistry

func NewRegistry(c *portercontext.Context) *Registry

func (*Registry) PullBundle

func (r *Registry) PullBundle(tag string, insecureRegistry bool) (bundle.Bundle, *relocation.ImageRelocationMap, 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(bun bundle.Bundle, tag string, insecureRegistry bool) (*relocation.ImageRelocationMap, error)

func (*Registry) PushInvocationImage

func (r *Registry) PushInvocationImage(invocationImage string) (string, 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(tag string, insecureRegistry bool) (bundle.Bundle, *relocation.ImageRelocationMap, error)

	// PushBundle pushes a bundle to an OCI registry.
	PushBundle(bun bundle.Bundle, tag string, insecureRegistry bool) (*relocation.ImageRelocationMap, 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(invocationImage string) (string, error)
}

Registry handles talking with an OCI registry.

type TestRegistry

type TestRegistry struct {
	MockPullBundle          func(tag string, insecureRegistry bool) (bun bundle.Bundle, reloMap *relocation.ImageRelocationMap, err error)
	MockPushBundle          func(bun bundle.Bundle, tag string, insecureRegistry bool) (reloMap *relocation.ImageRelocationMap, err error)
	MockPushInvocationImage func(invocationImage string) (imageDigest string, err error)
}

func NewTestRegistry

func NewTestRegistry() *TestRegistry

func (TestRegistry) PullBundle

func (t TestRegistry) PullBundle(tag string, insecureRegistry bool) (bundle.Bundle, *relocation.ImageRelocationMap, error)

func (TestRegistry) PushBundle

func (t TestRegistry) PushBundle(bun bundle.Bundle, tag string, insecureRegistry bool) (*relocation.ImageRelocationMap, error)

func (TestRegistry) PushInvocationImage

func (t TestRegistry) PushInvocationImage(invocationImage string) (string, error)

Jump to

Keyboard shortcuts

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