Documentation ¶
Index ¶
- Constants
- Variables
- func FindImageMatch(images apiv1.ImageList, search string) (*apiv1.Image, string, error)
- func ForwardUpdates(progress chan<- ImageProgress, updates chan SimpleUpdate)
- func GetAuthenticationRemoteOptions(ctx context.Context, client client.Reader, namespace string, ...) ([]remote.Option, error)
- func GetAuthenticationRemoteOptionsWithLocalAuth(ctx context.Context, registry authn.Resource, localAuth *apiv1.RegistryAuth, ...) ([]remote.Option, error)
- func GetImageReference(ctx context.Context, c client.Reader, namespace, image string) (imagename.Reference, error)
- func GetRuntimePullableImageReference(ctx context.Context, c client.Reader, namespace, image string) (imagename.Reference, error)
- func ImageDigest(ctx context.Context, c client.Reader, namespace, image string, ...) (string, error)
- func IsImageRemote(ctx context.Context, c client.Reader, namespace, image string, ...) bool
- func ListTags(ctx context.Context, c client.Reader, namespace, image string, ...) (imagename.Reference, []string, error)
- func ParseReferenceNoDefault(name string) (imagename.Reference, error)
- func PullAppImage(ctx context.Context, c client.Client, namespace, image, nestedDigest string, ...) (*v1.AppImage, error)
- func RemoteWrite(progress chan<- SimpleUpdate, destRef name.Reference, source any, ...)
- func ResolveTag(tag imagename.Reference, image string) string
- func ResolveTagForApp(ctx context.Context, c client.Client, app *v1.AppInstance, image string) (string, error)
- type AppImageWithData
- type ErrImageIdentifierNotUnique
- type ErrImageNotFound
- type ImageProgress
- type SimpleKeychain
- type SimpleUpdate
Constants ¶
const NoDefaultRegistry = "xxx-no-reg"
Variables ¶
var (
DigestPattern = regexp.MustCompile(`^sha256:[a-f\d]{64}$`)
)
Functions ¶
func FindImageMatch ¶
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 ForwardUpdates ¶
func ForwardUpdates(progress chan<- ImageProgress, updates chan SimpleUpdate)
func GetImageReference ¶
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 IsImageRemote ¶
func IsImageRemote(ctx context.Context, c client.Reader, namespace, image string, noDefaultRegistry bool, opts ...remote.Option) bool
IsImageRemote checks the remote registry to see if the given image name exists. If noDefaultRegistry is true, and the image does not have a specified registry, this function will return false without attempting to check any remote registries.
func ParseReferenceNoDefault ¶
func PullAppImage ¶
func RemoteWrite ¶
Types ¶
type AppImageWithData ¶
type ErrImageIdentifierNotUnique ¶
type ErrImageIdentifierNotUnique struct {
ImageSearch string
}
func (ErrImageIdentifierNotUnique) Error ¶
func (e ErrImageIdentifierNotUnique) Error() string
type ErrImageNotFound ¶
type ErrImageNotFound struct {
ImageSearch string
}
func (ErrImageNotFound) Error ¶
func (e ErrImageNotFound) Error() string
type ImageProgress ¶
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)
type SimpleUpdate ¶
type SimpleUpdate struct {
// contains filtered or unexported fields
}