publish

package
v1.9.8 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

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 (
	// KindDomain is a sentinel "registry" that represents side-loading images into kind nodes.
	KindDomain = "kind.local"
)
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 build.Result to a registry incorporating the
	// provided string into the image's repository name.  Returns the digest
	// of the published image.
	Publish(build.Result, 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

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 NewKindPublisher

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

NewKindPublisher returns a new publish.Interface that loads images into kind nodes.

func NewLayout

func NewLayout(path string) (Interface, error)

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

func NewTarball

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

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

type LayoutPublisher

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

func (*LayoutPublisher) Close

func (l *LayoutPublisher) Close() error

func (*LayoutPublisher) Publish

func (l *LayoutPublisher) Publish(br build.Result, 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.

Directories

Path Synopsis
Package kind defines methods for publishing images into kind nodes.
Package kind defines methods for publishing images into kind nodes.

Jump to

Keyboard shortcuts

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