images

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCouldNotResolve = errors.New("could not resolve image with registered resolvers")

ErrCouldNotResolve is returned when image couldn't be resolved.

View Source
var (
	// ErrNotFound is returned when there is no environment variable set for
	// given KO path.
	ErrNotFound = errors.New("expected environment variable not found")
)
View Source
var Resolvers = make([]Resolver, 0, 1) //nolint:gochecknoglobals

Resolvers an array of resolvers to which resolvers could be added for downstream projects.

Functions

func ResolveImages

func ResolveImages(packages []PackageResolver) environment.EnvOpts

ResolveImages will try to resolve the images, using given resolver(s).

Types

type EnvironmentalBasedResolver

type EnvironmentalBasedResolver struct {
	Prefix string
}

EnvironmentalBasedResolver will try to resolve the images from prefixed environment variables.

func (*EnvironmentalBasedResolver) Applicable

func (c *EnvironmentalBasedResolver) Applicable() bool

func (*EnvironmentalBasedResolver) Resolve

func (c *EnvironmentalBasedResolver) Resolve(kopath string) (name.Reference, error)

type PackageResolver added in v0.34.0

type PackageResolver func(ctx context.Context) string

PackageResolver is a function that will return package name for given context.

func ExplicitPackage added in v0.34.0

func ExplicitPackage(pack string) PackageResolver

ExplicitPackage will return given package.

type Resolver

type Resolver interface {
	// Resolve will resolve given KO package path into real OCI image reference.
	Resolve(kopath string) (name.Reference, error)
	// Applicable will tell that given resolver is applicable to current runtime
	// environment, or not.
	Applicable() bool
}

Resolver will resolve given KO package paths into real OCI images references. This interface probably should be moved into reconciler-test framework. See: https://github.com/knative-sandbox/reconciler-test/issues/303

Jump to

Keyboard shortcuts

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