Documentation ¶
Overview ¶
Package carvelhelpers implements wrapper functions to use carvel tooling
Index ¶
- func CarvelPackageProcessor(pkgDir, _ string, valuesFiles ...string) ([]byte, error)
- func DownloadImageAndSaveFilesToDir(imageWithTag, destinationDir string) error
- func GetFilesMapFromImage(imageWithTag string) (map[string][]byte, error)
- func GetImageDigest(imageWithTag string) (string, string, error)
- func ProcessCarvelPackage(image string, valuesFiles ...string) ([]byte, error)
- func ProcessYTTPackage(configDirs ...string) ([]byte, error)
- func ResolveImagesInPackage(files []string) ([]byte, error)
- type ImageOperationOptions
- func (i *ImageOperationOptions) CopyImageFromTar(sourceTarFile, destImageRepo string) error
- func (i *ImageOperationOptions) CopyImageToTar(sourceImageName, destTarFile string) error
- func (i *ImageOperationOptions) DownloadImageAndSaveFilesToDir(imageWithTag, destinationDir string) error
- func (i *ImageOperationOptions) GetFileDigestFromImage(imageWithTag, fileName string) (string, error)
- func (i *ImageOperationOptions) GetFilesMapFromImage(imageWithTag string) (map[string][]byte, error)
- func (i *ImageOperationOptions) GetImageDigest(imageWithTag string) (string, string, error)
- func (i *ImageOperationOptions) PushImage(imageWithTag string, filePaths []string) error
- func (i *ImageOperationOptions) ResolveImage(imageWithTag string) error
- type ImageOperationsImpl
- type NoopUI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CarvelPackageProcessor ¶
CarvelPackageProcessor processes a carvel package and returns a configuration YAML file
func DownloadImageAndSaveFilesToDir ¶
DownloadImageAndSaveFilesToDir reads a plain OCI image and saves its files to the specified location.
func GetFilesMapFromImage ¶
GetFilesMapFromImage returns map of files metadata It takes os environment variables for custom repository and proxy configuration into account while downloading image from repository
func GetImageDigest ¶ added in v0.0.11
GetImageDigest gets digest of the image
func ProcessCarvelPackage ¶
ProcessCarvelPackage processes a carvel package and returns a configuration YAML Downloads package to temporary directory and processes the package by implementing equivalent functionality as the command: `ytt -f <path> [-f <values-files>] | kbld -f -`
func ProcessYTTPackage ¶
ProcessYTTPackage processes configuration directory with ytt tool Implements similar functionality as `ytt -f <config-dir>`
func ResolveImagesInPackage ¶
ResolveImagesInPackage resolves the images using kbld tool Implements similar functionality as `kbld -f <file1> -f <file2>`
Types ¶
type ImageOperationOptions ¶ added in v0.90.0
type ImageOperationOptions struct{}
ImageOperationOptions implements the ImageOperationsImpl interface by using `imgpkg` library
func (*ImageOperationOptions) CopyImageFromTar ¶ added in v0.90.0
func (i *ImageOperationOptions) CopyImageFromTar(sourceTarFile, destImageRepo string) error
CopyImageFromTar publishes the image to destination repository from specified tar file This is equivalent to `imgpkg copy --tar <file> --to-repo <dest-repo>` command
func (*ImageOperationOptions) CopyImageToTar ¶ added in v0.90.0
func (i *ImageOperationOptions) CopyImageToTar(sourceImageName, destTarFile string) error
CopyImageToTar downloads the image as tar file This is equivalent to `imgpkg copy --image <image> --to-tar <tar-file-path>` command
func (*ImageOperationOptions) DownloadImageAndSaveFilesToDir ¶ added in v0.90.0
func (i *ImageOperationOptions) DownloadImageAndSaveFilesToDir(imageWithTag, destinationDir string) error
DownloadImageAndSaveFilesToDir reads a plain OCI image and saves its files to the specified location.
func (*ImageOperationOptions) GetFileDigestFromImage ¶ added in v1.0.0
func (i *ImageOperationOptions) GetFileDigestFromImage(imageWithTag, fileName string) (string, error)
GetFileDigestFromImage invokes `DownloadImageAndSaveFilesToDir` to fetch the image and returns the digest of the specified file
func (*ImageOperationOptions) GetFilesMapFromImage ¶ added in v0.90.0
func (i *ImageOperationOptions) GetFilesMapFromImage(imageWithTag string) (map[string][]byte, error)
GetFilesMapFromImage returns map of files metadata It takes os environment variables for custom repository and proxy configuration into account while downloading image from repository
func (*ImageOperationOptions) GetImageDigest ¶ added in v0.90.0
func (i *ImageOperationOptions) GetImageDigest(imageWithTag string) (string, string, error)
GetImageDigest gets digest of the image
func (*ImageOperationOptions) PushImage ¶ added in v0.90.0
func (i *ImageOperationOptions) PushImage(imageWithTag string, filePaths []string) error
PushImage publishes the image to the specified location
func (*ImageOperationOptions) ResolveImage ¶ added in v1.0.0
func (i *ImageOperationOptions) ResolveImage(imageWithTag string) error
ResolveImage invokes `imgpkg tag resolve -i <image>` command
type ImageOperationsImpl ¶ added in v0.90.0
type ImageOperationsImpl interface { // CopyImageToTar downloads the image as tar file // This is equivalent to `imgpkg copy --image <image> --to-tar <tar-file-path>` command CopyImageToTar(sourceImageName, destTarFile string) error // CopyImageFromTar publishes the image to destination repository from specified tar file // This is equivalent to `imgpkg copy --tar <file> --to-repo <dest-repo>` command CopyImageFromTar(sourceTarFile, destImageRepo string) error // DownloadImageAndSaveFilesToDir reads a plain OCI image and saves its // files to the specified location. DownloadImageAndSaveFilesToDir(imageWithTag, destinationDir string) error // GetFilesMapFromImage returns map of files metadata // It takes os environment variables for custom repository and proxy // configuration into account while downloading image from repository GetFilesMapFromImage(imageWithTag string) (map[string][]byte, error) // GetImageDigest gets digest of the image GetImageDigest(imageWithTag string) (string, string, error) // PushImage publishes the image to the specified location // This is equivalent to `imgpkg push -i <image> -f <filepath>` PushImage(imageWithTag string, filePaths []string) error // ResolveImage invokes `imgpkg tag resolve -i <image>` command ResolveImage(imageWithTag string) error // GetFileDigestFromImage invokes `DownloadImageAndSaveFilesToDir` to fetch the image and returns the digest of the specified file GetFileDigestFromImage(imageWithTag, fileName string) (string, error) }
ImageOperationsImpl defines the helper functions for downloading, copying and processing oci images
func NewImageOperationsImpl ¶ added in v0.90.0
func NewImageOperationsImpl() ImageOperationsImpl
NewImageOperationsImpl creates new ImgpkgWrapper instance