v1

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package v1 contains the public API version 1 used by other tools to interact with imgpkg

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptsFromEnv

func OptsFromEnv(base registry.Opts, readEnv func(string) (string, bool)) registry.Opts

OptsFromEnv Using the base Opts fills up the missing information using the environment variables

Types

type Author

type Author struct {
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
}

Author information from a Bundle

type BundleInfo

type BundleInfo struct {
	ImageRef      string          `json:"image"`
	ImagesLock    *ImagesLockInfo `json:"imagesLock,omitempty"`
	NestedBundles []BundleInfo    `json:"nestedBundles,omitempty"`
}

BundleInfo Information related to the specific bundle

type Content

type Content struct {
	Bundles map[string]Description `json:"bundles,omitempty"`
	Images  map[string]ImageInfo   `json:"images,omitempty"`
}

Content Contents present in a Bundle

type DescribeOpts

type DescribeOpts struct {
	Logger                 bundle.Logger
	Concurrency            int
	IncludeCosignArtifacts bool
}

DescribeOpts Options used when calling the Describe function

type Description

type Description struct {
	Image       string            `json:"image"`
	Origin      string            `json:"origin"`
	Annotations map[string]string `json:"annotations,omitempty"`
	Metadata    Metadata          `json:"metadata,omitempty"`
	Content     Content           `json:"content"`
	Layers      []Layers          `json:"layers,omitempty"`
}

Description Metadata and Contents of a Bundle

func Describe

func Describe(bundleImage string, opts DescribeOpts, registryOpts registry.Opts) (Description, error)

Describe Given a Bundle URL fetch the information about the contents of the Bundle and Nested Bundles

func DescribeWithRegistryAndSignatureFetcher

func DescribeWithRegistryAndSignatureFetcher(bundleImage string, opts DescribeOpts, reg bundle.ImagesMetadata, sigFetcher SignatureFetcher) (Description, error)

DescribeWithRegistryAndSignatureFetcher Given a Bundle URL fetch the information about the contents of the Bundle and Nested Bundles

type ErrIsBundle

type ErrIsBundle struct{}

ErrIsBundle Error when the provided Image Reference is a Bundle

func (ErrIsBundle) Error

func (e ErrIsBundle) Error() string

Error message

func (ErrIsBundle) Is

func (e ErrIsBundle) Is(target error) bool

Is check if the error is of the type ErrIsBundle

type ErrIsNotBundle

type ErrIsNotBundle struct{}

ErrIsNotBundle Error when the provided Image Reference is not a Bundle

func (ErrIsNotBundle) Error

func (e ErrIsNotBundle) Error() string

Error message

func (ErrIsNotBundle) Is

func (e ErrIsNotBundle) Is(target error) bool

Is check if the error is of the type ErrIsNotBundle

type ImageInfo

type ImageInfo struct {
	Image       string            `json:"image,omitempty"`
	Origin      string            `json:"origin,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
	ImageType   bundle.ImageType  `json:"imageType"`
	Error       string            `json:"error,omitempty"`
	Layers      []Layers          `json:"layers,omitempty"`
}

ImageInfo URLs where the image can be found as well as annotations provided in the Images Lock

type ImagesLockInfo

type ImagesLockInfo struct {
	Path    string `json:"path"`
	Updated bool   `json:"updated"`
}

ImagesLockInfo Information about the ImagesLock file

type Layers added in v0.40.0

type Layers struct {
	Digest string `json:"digest,omitempty"`
}

Layers image layers info

type Logger

type Logger interface {
	Errorf(msg string, args ...interface{})
	Warnf(msg string, args ...interface{})
	Debugf(msg string, args ...interface{})
	Tracef(msg string, args ...interface{})
	Logf(msg string, args ...interface{})
}

Logger Interface used for logging

type Metadata

type Metadata struct {
	Metadata map[string]string `json:"metadata,omitempty"`
	Authors  []Author          `json:"authors,omitempty"`
	Websites []Website         `json:"websites,omitempty"`
}

Metadata Extra metadata present in a Bundle

type PullOpts

type PullOpts struct {
	Logger Logger
	// AsImage Pull the contents of the OCI Image
	AsImage bool
	// IsBundle the image being pulled is a Bundle
	IsBundle bool
}

PullOpts Option that can be provided to the pull request

type PullStatus

type PullStatus struct {
	BundleInfo
	IsBundle  bool `json:"-"`
	Cacheable bool `json:"cacheable"`
}

PullStatus Report from the Pull command

func Pull

func Pull(imageRef string, outputPath string, pullOptions PullOpts, registryOpts registry.Opts) (PullStatus, error)

Pull Download the contents of the image referenced by imageRef to the folder outputPath

func PullRecursive

func PullRecursive(imageRef string, outputPath string, pullOptions PullOpts, registryOpts registry.Opts) (PullStatus, error)

PullRecursive Downloads the contents of the Bundle and Nested Bundles referenced by imageRef to the folder outputPath. This functions should error out when imageRef does not point to a Bundle

func PullRecursiveWithRegistry

func PullRecursiveWithRegistry(imageRef string, outputPath string, pullOptions PullOpts, reg registry.Registry) (PullStatus, error)

PullRecursiveWithRegistry Downloads the contents of the Bundle and Nested Bundles referenced by imageRef to the folder outputPath. This functions should error out when imageRef does not point to a Bundle

func PullWithRegistry

func PullWithRegistry(imageRef string, outputPath string, pullOptions PullOpts, reg registry.Registry) (PullStatus, error)

PullWithRegistry Download the contents of the image referenced by imageRef to the folder outputPath

type SignatureFetcher

type SignatureFetcher interface {
	FetchForImageRefs(images []lockconfig.ImageRef) ([]lockconfig.ImageRef, error)
}

SignatureFetcher Interface to retrieve signatures associated with Images

type Status

type Status PullStatus

Status Report from the Pull command Deprecated: in favor of PullStatus, the name makes more sense for API.

type TagInfo

type TagInfo struct {
	Tag    string
	Digest string
}

TagInfo Contains the tag name and the digest associated with the tag TagInfo.Digest might be empty if caller ask for it not to be retrieved

type TagsInfo

type TagsInfo struct {
	Repository string
	Tags       []TagInfo
}

TagsInfo Contains all the tags associated with the repository on Image

func TagList

func TagList(imageRef string, getDigests bool, registryOpts registry.Opts) (TagsInfo, error)

TagList Retrieve all the tags associated with a repository imageRef contains the address for the repository getDigests when set to true, provides

type Website

type Website struct {
	URL string `json:"url,omitempty"`
}

Website URL where more information of the Bundle can be found

Jump to

Keyboard shortcuts

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