Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAndVisitLayerContents ¶
func ExtractAndVisitLayerContents(ctx context.Context, layer v1.Layer, lcv LayerContentsVisitor) error
ExtractAndVisitLayerContents uncompresses the layer and traverses the tarball contents calling the supplied visitor on each entry.
func GetRegistryHostname ¶
GetRegistryHostname extracts the registry hostname from an image reference. For example: "gcr.io/project/image@sha256:abc..." returns "gcr.io"
func ValidateImageReferenceIsShaDigest ¶
ValidateImageReferenceIsShaDigest validates that an image reference uses SHA256 digest format.
Types ¶
type ImagePuller ¶
type ImagePuller struct {
// contains filtered or unexported fields
}
ImagePuller pulls Docker images from container registries.
func NewImagePuller ¶
func NewImagePuller(authConfig map[string]*RegistryAuth, maxImageSizeBytes int64, pullTimeout time.Duration) *ImagePuller
NewImagePuller creates a new ImagePuller with the specified configuration.
func (*ImagePuller) GetImageFromRef ¶
func (p *ImagePuller) GetImageFromRef(imageRef string) (v1.Image, context.CancelFunc, error)
GetImageFromRef pulls a Docker image by its reference (tag or digest). The returned CancelFunc must be called after we're done using the image.
type LayerContentsVisitor ¶
type LayerContentsVisitor interface {
OnDirectorySeen(ctx context.Context, path string) error
OnFileSeen(ctx context.Context, path string, data io.Reader, mode int64) error
OnLinkSeen(ctx context.Context, path, target string) error
OnSymlinkSeen(ctx context.Context, path, target string) error
OnLayerComplete(ctx context.Context) error
}
LayerContentsVisitor is called for each entry (directory, file, link, symlink) found in a Docker layer.
type RegistryAuth ¶
RegistryAuth holds authentication credentials for a Docker registry.