ko

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func New

func New() *Manager

New creates a ko Manager.

func (*Manager) BuildLocal

func (m *Manager) BuildLocal(ctx context.Context, packagePath string, opts ...Option) (context.Context, error)

BuildLocal builds container image from the given packagePath and publishes it to a local repository supported by ko. It returns the container image ID within the ctx.

func (*Manager) GetLocalImage

func (m *Manager) GetLocalImage(ctx context.Context, packagePath string) (string, error)

GetLocalImage returns the previously built container image ID for packagePath from ctx.

func (*Manager) Install

func (m *Manager) Install(version string) error

Install install ko with `go install` if ko not found in PATH

func (*Manager) WithPath

func (m *Manager) WithPath(path string) *Manager

WithPath is used to provide a custom path where the `ko` executable command can be found. This is useful in case if your binary is in a non standard location and you want to framework to use that instead of returning an error.

type Option

type Option func(*Opts)

func WithConfigFile

func WithConfigFile(configFile string) Option

WithConfigFile is used to configure the ko config file path.

func WithLocalKindName

func WithLocalKindName(name string) Option

WithLocalKind is used to configure the build and publish target as a local kind cluster.

func WithPlatforms

func WithPlatforms(platforms ...string) Option

WithPlatforms is used to configure the platform to use when pulling a multi-platform base at the building phase. When platform="all", it will build and push an image for all platforms supported by the configured base image. platform string format: all | <os>[/<arch>[/<variant>]][,platform]*

type Opts

type Opts struct {
	// LocalKindName is used to indicate the local kind cluster to publish.
	LocalKindName string
	// Platforms is used to indicate the platforms to build and publish.
	Platforms []string
	// ConfigFile is used to indicate the ko config file path.
	ConfigFile string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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