publish

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 15 Imported by: 14

Documentation

Overview

Package publish defines methods for publishing a v1.Image reference and returning the published digest for embedding back into a Kubernetes yaml.

Index

Constants

View Source
const (
	// LocalDomain is a sentinel "registry" that represents side-loading images into the daemon.
	LocalDomain = "ko.local"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Publish uploads the given v1.Image to a registry incorporating the
	// provided string into the image's repository name.  Returns the digest
	// of the published image.
	Publish(v1.Image, string) (name.Reference, error)

	// Close exists for the tarball implementation so we can
	// do the whole thing in one write.
	Close() error
}

Interface abstracts different methods for publishing images.

func MultiPublisher added in v0.4.0

func MultiPublisher(publishers ...Interface) Interface

MultiPublisher creates a publisher that publishes to all the provided publishers, similar to the Unix tee(1) command.

When calling Publish, the name.Reference returned will be the return value of the last publisher passed to MultiPublisher (last one wins).

func NewCaching

func NewCaching(inner Interface) (Interface, error)

NewCaching wraps the provided publish.Interface in an implementation that shares publish results for a given path until the passed image object changes.

func NewDaemon

func NewDaemon(namer Namer, tags []string) Interface

NewDaemon returns a new publish.Interface that publishes images to a container daemon.

func NewDefault

func NewDefault(base string, options ...Option) (Interface, error)

NewDefault returns a new publish.Interface that publishes references under the provided base repository using the default keychain to authenticate and the default naming scheme.

func NewLayout added in v0.4.0

func NewLayout(path string) (Interface, error)

NewLayout returns a new publish.Interface that saves images to an OCI Image Layout.

type LayoutPublisher added in v0.4.0

type LayoutPublisher struct {
	// contains filtered or unexported fields
}

func (*LayoutPublisher) Close added in v0.4.0

func (l *LayoutPublisher) Close() error

func (*LayoutPublisher) Publish added in v0.4.0

func (l *LayoutPublisher) Publish(img v1.Image, s string) (name.Reference, error)

Publish implements publish.Interface.

type Namer

type Namer func(string) string

Namer is a function from a supported import path to the portion of the resulting image name that follows the "base" repository name.

type Option

type Option func(*defaultOpener) error

Option is a functional option for NewDefault.

func Insecure

func Insecure(b bool) Option

func WithAuth

func WithAuth(auth authn.Authenticator) Option

WithAuth is a functional option for overriding the default authenticator on a default publisher.

func WithAuthFromKeychain

func WithAuthFromKeychain(keys authn.Keychain) Option

WithAuthFromKeychain is a functional option for overriding the default authenticator on a default publisher using an authn.Keychain

func WithNamer

func WithNamer(n Namer) Option

WithNamer is a functional option for overriding the image naming behavior in our default publisher.

func WithTags

func WithTags(tags []string) Option

WithTags is a functional option for overriding the image tags

func WithTransport

func WithTransport(t http.RoundTripper) Option

WithTransport is a functional option for overriding the default transport on a default publisher.

type TarballPublisher added in v0.4.0

type TarballPublisher struct {
	// contains filtered or unexported fields
}

func NewTarball added in v0.4.0

func NewTarball(file, base string, namer Namer, tags []string) *TarballPublisher

NewTarball returns a new publish.Interface that saves images to a tarball.

func (*TarballPublisher) Close added in v0.4.0

func (t *TarballPublisher) Close() error

func (*TarballPublisher) Publish added in v0.4.0

func (t *TarballPublisher) Publish(img v1.Image, s string) (name.Reference, error)

Publish implements publish.Interface.

Jump to

Keyboard shortcuts

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