images

package
v0.8.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const NoDefaultRegistry = "xxx-no-reg"

Variables

View Source
var (
	DigestPattern = regexp.MustCompile(`^sha256:[a-f\d]{64}$`)
)

Functions

func FindImageMatch

func FindImageMatch(images apiv1.ImageList, search string) (*apiv1.Image, string, error)

findImageMatch matches images by digest, digest prefix, or tag name:

- digest (raw): sha256:<digest> or <digest> (exactly 64 chars) - digest (image): <registry>/<repo>@sha256:<digest> or <repo>@sha256:<digest> - digest prefix: sha256:<digest prefix> (min. 3 chars) - tag name: <registry>/<repo>:<tag> or <repo>:<tag> - tag name (with default): <registry>/<repo> or <repo> -> Will be matched against the default tag (:latest)

  • Note: if we get some string here, that matches the SHAPermissivePrefixPattern, it could be both a digest or a name without a tag so we will try to match it against the default tag (:latest) first and if that fails, we treat it as a digest(-prefix)

func GetAuthenticationRemoteKeychainWithLocalAuth

func GetAuthenticationRemoteKeychainWithLocalAuth(ctx context.Context, registry authn.Resource, localAuth *apiv1.RegistryAuth, client client.Reader, namespace string) (authn.Keychain, error)

func GetAuthenticationRemoteOptions

func GetAuthenticationRemoteOptions(ctx context.Context, client client.Reader, namespace string, additionalOpts ...remote.Option) ([]remote.Option, error)

func GetAuthenticationRemoteOptionsWithLocalAuth

func GetAuthenticationRemoteOptionsWithLocalAuth(ctx context.Context, registry authn.Resource, localAuth *apiv1.RegistryAuth, client client.Reader, namespace string, additionalOpts ...remote.Option) ([]remote.Option, error)

func GetImageReference

func GetImageReference(ctx context.Context, c client.Reader, namespace, image string) (imagename.Reference, error)

func GetRuntimePullableImageReference

func GetRuntimePullableImageReference(ctx context.Context, c client.Reader, namespace, image string) (imagename.Reference, error)

GetRuntimePullableImageReference is similar to GetImageReference but will return 127.0.0.1:NODEPORT instead of registry.acorn-image-system.svc.cluster.local:5000, only use this method if you are passing the image string to a PodSpec that will be pulled by the container runtime, otherwise use GetImageReference if you will be pulling the image from the apiserver/controller

func ImageDigest

func ImageDigest(ctx context.Context, c client.Reader, namespace, image string, opts ...remote.Option) (string, error)

func ListTags

func ListTags(ctx context.Context, c client.Reader, namespace, image string, opts ...remote.Option) (imagename.Reference, []string, error)

func ParseReferenceNoDefault

func ParseReferenceNoDefault(name string) (imagename.Reference, error)

func PullAppImage

func PullAppImage(ctx context.Context, c client.Reader, namespace, image, nestedDigest string, opts ...remote.Option) (*v1.AppImage, error)

func ResolveTag

func ResolveTag(tag imagename.Reference, image string) string

func ResolveTagForApp

func ResolveTagForApp(ctx context.Context, c client.Client, app *v1.AppInstance, image string) (string, error)

Types

type ErrImageIdentifierNotUnique

type ErrImageIdentifierNotUnique struct {
	ImageSearch string
}

func (ErrImageIdentifierNotUnique) Error

type ErrImageNotFound

type ErrImageNotFound struct {
	ImageSearch string
}

func (ErrImageNotFound) Error

func (e ErrImageNotFound) Error() string

type SimpleKeychain

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

func NewSimpleKeychain

func NewSimpleKeychain(resource authn.Resource, auth apiv1.RegistryAuth, next authn.Keychain) *SimpleKeychain

func (*SimpleKeychain) Authorization

func (s *SimpleKeychain) Authorization() (*authn.AuthConfig, error)

func (*SimpleKeychain) Resolve

func (s *SimpleKeychain) Resolve(resource authn.Resource) (authn.Authenticator, error)

Jump to

Keyboard shortcuts

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