Documentation ¶
Index ¶
- Constants
- Variables
- func FindImageMatch(images apiv1.ImageList, search string) (*apiv1.Image, string, error)
- func GetAuthenticationRemoteKeychainWithLocalAuth(ctx context.Context, registry authn.Resource, localAuth *apiv1.RegistryAuth, ...) (authn.Keychain, error)
- 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 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.Reader, namespace, image, nestedDigest string, ...) (*v1.AppImage, error)
- func ResolveTag(tag imagename.Reference, image string) string
- func ResolveTagForApp(ctx context.Context, c client.Client, app *v1.AppInstance, image string) (string, error)
- type ErrImageIdentifierNotUnique
- type ErrImageNotFound
- type SimpleKeychain
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 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 ParseReferenceNoDefault ¶
func PullAppImage ¶
Types ¶
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 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)