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
- type DaemonOption
- type Interface
- func MultiPublisher(publishers ...Interface) Interface
- func NewCaching(inner Interface) (Interface, error)
- func NewDaemon(namer Namer, tags []string, opts ...DaemonOption) (Interface, error)
- func NewDefault(base string, options ...Option) (Interface, error)
- func NewKindPublisher(base string, namer Namer, tags []string) Interface
- func NewLayout(path string) (Interface, error)
- func NewRecorder(inner Interface, wc io.Writer) (Interface, error)
- func NewTarball(file, base string, namer Namer, tags []string) Interface
- type LayoutPublisher
- type Namer
- type Option
- func Insecure(b bool) Option
- func WithAuth(a authn.Authenticator) Option
- func WithAuthFromKeychain(keys authn.Keychain) Option
- func WithJobs(jobs int) Option
- func WithNamer(n Namer) Option
- func WithTagOnly(tagOnly bool) Option
- func WithTags(tags []string) Option
- func WithTransport(t http.RoundTripper) Option
- func WithUserAgent(ua string) Option
Constants ¶
const (
// KindDomain is a sentinel "registry" that represents side-loading images into kind nodes.
KindDomain = "kind.local"
)
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 DaemonOption ¶ added in v0.9.0
type DaemonOption func(*demon) error
DaemonOption is a functional option for NewDaemon.
func WithDockerClient ¶ added in v0.9.0
func WithDockerClient(client daemon.Client) DaemonOption
WithDockerClient is a functional option for overriding the docker client.
func WithLocalDomain ¶ added in v0.9.0
func WithLocalDomain(domain string) DaemonOption
WithLocalDomain is a functional option for overriding the domain used for images that are side-loaded into the daemon.
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(context.Context, 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 ¶ added in v0.4.0
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 ¶
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, opts ...DaemonOption) (Interface, error)
NewDaemon returns a new publish.Interface that publishes images to a container daemon.
func NewDefault ¶
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 ¶ added in v0.6.0
NewKindPublisher returns a new publish.Interface that loads images into kind nodes.
func NewLayout ¶ added in v0.4.0
NewLayout returns a new publish.Interface that saves images to an OCI Image Layout.
func NewRecorder ¶ added in v0.10.0
NewRecorder wraps the provided publish.Interface in an implementation that records publish results to an io.Writer.
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
type Namer ¶
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 WithAuth ¶
func WithAuth(a authn.Authenticator) Option
WithAuth is a functional option for overriding the default authenticator on a default publisher.
func WithAuthFromKeychain ¶
WithAuthFromKeychain is a functional option for overriding the default authenticator on a default publisher using an authn.Keychain
func WithNamer ¶
WithNamer is a functional option for overriding the image naming behavior in our default publisher.
func WithTagOnly ¶ added in v0.9.0
WithTagOnly is a functional option for resolving images into tag-only references
func WithTransport ¶
func WithTransport(t http.RoundTripper) Option
WithTransport is a functional option for overriding the default transport on a default publisher.
func WithUserAgent ¶ added in v0.8.0
WithUserAgent is a functional option for overriding the User-Agent on a default publisher.