images

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportImage added in v0.0.3

func ExportImage(src string, tarFilePath string) error

ExportImage uses crane to export an image to a tarball It is basically the same code as crane export https://github.com/google/go-containerregistry/blob/a0658aa1d0cc7a7f1bcc4a3af9155335b6943f40/cmd/crane/cmd/export.go#L55

This is different from image downloader because that appears to download the manifest and individual blobs.

func ParseImageList

func ParseImageList(imageListPath string) (imageList v1alpha1.ImageList, err error)

ParseImageList attempts to initialize an ImageList object from the supplied path

func ReconcileFile added in v0.0.2

func ReconcileFile(path string) error

ReconcileFile reconciles the images defined in a set of files. It is a helper function primarily used by the CLI

Types

type Controller added in v0.0.2

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

Controller for images. A controller is capable of building images and resolving images to shas.

func NewController added in v0.0.2

func NewController() (*Controller, error)

func (*Controller) Reconcile added in v0.0.2

func (c *Controller) Reconcile(ctx context.Context, image *v1alpha1.Image) error

Reconcile an image. This will build the image if necessary and resolve the image to a sha. Status is updated with status about the image. basePath is the basePath to resolve paths against

func (*Controller) SetLocalRepos added in v0.0.3

func (c *Controller) SetLocalRepos(repos []GitRepoRef) error

SetLocalRepos sets the local repositories to use when resolving images

type Extractor

type Extractor struct {
	Log logr.Logger
}

Extractor extracts the URLs of all the docker images in a directory of manifests

func (*Extractor) Extract

func (e *Extractor) Extract(sourceDir string, output io.Writer) error

Extract all the images

func (*Extractor) ExtractImages

func (e *Extractor) ExtractImages(sourceDir string) (*v1alpha1.ImageList, error)

ExtractImages returns all the images in a source directory

type GitRepoRef added in v0.0.3

type GitRepoRef struct {
	Repo *git.Repository
	W    *git.Worktree
}

GitRepoRef is a reference to a git repository. TODO(jeremy): Is this neccessary? Can we retrieve the Repo from the work tree? I don't think we want to always reconstruct the workTree from gitRepos because that could be expensive in particular updating the ignore patterns is expensive.

type ImageDownloader

type ImageDownloader struct {
	Log              logr.Logger
	ImageList        v1alpha1.ImageList
	ImageDir         string
	SkipIfFileExists bool
	DummyDownload    bool
}

ImageDownloader handles pulling images given ImageList

func (*ImageDownloader) DownloadImagesWithRetry

func (d *ImageDownloader) DownloadImagesWithRetry(retry int) error

DownloadImagesWithRetry calls DownloadImagesToDir, retrying if errors occur

type ImageUploader

type ImageUploader struct {
	Log        logr.Logger
	ImageDir   string
	TargetRepo string
	SkipUpload bool
}

ImageUploader handles upload images to target Repo given image dir

func (*ImageUploader) UploadImagesWithRetry

func (u *ImageUploader) UploadImagesWithRetry(retry int) (imageMappings []images.ImageMapping, err error)

UploadImagesWithRetry calls UploadImagesFromDir, retrying if errors occur

Jump to

Keyboard shortcuts

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