bundle

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImgpkgDir      = ".imgpkg"
	BundlesDir     = "bundles"
	ImagesLockFile = "images.yml"
)
View Source
const (
	LocationFilepath   = "image-locations.yml"
	ImageLocationsKind = "ImageLocations"
	LocationAPIVersion = "imgpkg.carvel.dev/v1alpha1"
)
View Source
const (
	BundleConfigLabel = "dev.carvel.imgpkg.bundle"
)

Variables

This section is empty.

Functions

func IsNotBundleError

func IsNotBundleError(err error) bool

Types

type Author added in v0.26.0

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

Author information from a Bundle

type Bundle

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

func NewBundle

func NewBundle(ref string, imagesMetadata ImagesMetadata) *Bundle

func NewBundleFromPlainImage

func NewBundleFromPlainImage(plainImg *plainimg.PlainImage, imagesMetadata ImagesMetadata) *Bundle

func NewBundleWithReader

func NewBundleWithReader(ref string, imagesMetadata ImagesMetadata, imagesLockReader ImagesLockReader) *Bundle

func (*Bundle) AllImagesLockRefs added in v0.26.0

func (o *Bundle) AllImagesLockRefs(concurrency int, ui util.UIWithLevels) ([]*Bundle, ImageRefs, error)

AllImagesLockRefs returns a flat list of nested bundles and every image reference for a specific bundle

func (*Bundle) Digest added in v0.27.0

func (o *Bundle) Digest() string

Digest Bundle Digest

func (*Bundle) DigestRef

func (o *Bundle) DigestRef() string

DigestRef Bundle full location including registry, repository and digest

func (*Bundle) FetchAllImagesRefs added in v0.26.0

func (o *Bundle) FetchAllImagesRefs(concurrency int, ui Logger, sigFetcher SignatureFetcher) ([]*Bundle, error)

FetchAllImagesRefs returns a flat list of nested bundles and every image reference for a specific bundle

func (*Bundle) ImagesRefs added in v0.26.0

func (o *Bundle) ImagesRefs() []ImageRef

ImagesRefs Retrieve the references for the Images of this particular bundle

func (*Bundle) IsBundle

func (o *Bundle) IsBundle() (bool, error)

func (*Bundle) NoteCopy

func (o *Bundle) NoteCopy(processedImages *imageset.ProcessedImages, reg ImagesMetadataWriter, ui util.UIWithLevels) error

NoteCopy writes an image-location representing the bundle / images that have been copied

func (*Bundle) Pull

func (o *Bundle) Pull(outputPath string, ui goui.UI, pullNestedBundles bool) error

func (*Bundle) Repo

func (o *Bundle) Repo() string

Repo Bundle registry and Repository

func (*Bundle) Tag

func (o *Bundle) Tag() string

Tag Bundle Tag

func (*Bundle) UpdateImageRefs added in v0.23.0

func (o *Bundle) UpdateImageRefs(bundles []*Bundle) error

UpdateImageRefs updates the bundle cached images without talking to the registry

type Content added in v0.26.0

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

Content Contents present in a Bundle

type Contents

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

func NewContents

func NewContents(paths []string, excludedPaths []string) Contents

func (Contents) PresentsAsBundle

func (b Contents) PresentsAsBundle() (bool, error)

func (Contents) Push

func (b Contents) Push(uploadRef regname.Tag, registry ImagesMetadataWriter, ui ui.UI) (string, error)

type DescribeOpts added in v0.26.0

type DescribeOpts struct {
	Logger                 Logger
	Concurrency            int
	IncludeCosignArtifacts bool
}

DescribeOpts Options used when calling the Describe function

type Description added in v0.26.0

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"`
}

Description Metadata and Contents of a Bundle

func Describe added in v0.26.0

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 added in v0.26.0

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

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

type ImageInfo added in v0.26.0

type ImageInfo struct {
	Image       string            `json:"image"`
	Origin      string            `json:"origin"`
	Annotations map[string]string `json:"annotations,omitempty"`
	ImageType   ImageType         `json:"imageType"`
}

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

type ImageLocation

type ImageLocation struct {
	Image    string `json:"image"`    // This generated yaml, but due to lib we need to use `json`
	IsBundle bool   `json:"isBundle"` // This generated yaml, but due to lib we need to use `json`
}

type ImageLocationsConfig

type ImageLocationsConfig struct {
	APIVersion string          `json:"apiVersion"` // This generated yaml, but due to lib we need to use `json`
	Kind       string          `json:"kind"`       // This generated yaml, but due to lib we need to use `json`
	Images     []ImageLocation `json:"images"`     // This generated yaml, but due to lib we need to use `json`
}

func NewLocationConfigFromBytes

func NewLocationConfigFromBytes(data []byte) (ImageLocationsConfig, error)

func NewLocationConfigFromPath

func NewLocationConfigFromPath(path string) (ImageLocationsConfig, error)

func (ImageLocationsConfig) AsBytes

func (c ImageLocationsConfig) AsBytes() ([]byte, error)

func (ImageLocationsConfig) Validate

func (c ImageLocationsConfig) Validate() error

func (ImageLocationsConfig) WriteToPath

func (c ImageLocationsConfig) WriteToPath(path string) error

type ImageRef

type ImageRef struct {
	lockconfig.ImageRef
	IsBundle  *bool
	Copiable  bool
	ImageType ImageType
}

func NewBundleImageRef added in v0.26.0

func NewBundleImageRef(imgRef lockconfig.ImageRef) ImageRef

NewBundleImageRef Constructs a new ImageRef for Bundle

func NewContentImageRef added in v0.26.0

func NewContentImageRef(imgRef lockconfig.ImageRef) ImageRef

NewContentImageRef Constructs a new ImageRef for Image

func NewImageRefWithType added in v0.26.0

func NewImageRefWithType(imgRef lockconfig.ImageRef, imageType ImageType) ImageRef

NewImageRefWithType Constructs a new ImageRef based on the ImageType

func (ImageRef) DeepCopy

func (i ImageRef) DeepCopy() ImageRef

func (ImageRef) Digest added in v0.27.0

func (i ImageRef) Digest() string

Digest Image Digest

type ImageRefLocationsConfig

type ImageRefLocationsConfig interface {
	Config() (ImageLocationsConfig, error)
}

type ImageRefs

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

func NewImageRefs

func NewImageRefs() ImageRefs

func NewImageRefsFromImagesLock

func NewImageRefsFromImagesLock(imagesLock lockconfig.ImagesLock, imageRefsLocationConfig ImageRefLocationsConfig) (ImageRefs, error)

NewImageRefsFromImagesLock Create a new ImageRefs from the provided lockconfig.ImagesLock and ImageLocationsConfig

func (*ImageRefs) AddImagesRef

func (i *ImageRefs) AddImagesRef(refs ...ImageRef)

func (*ImageRefs) Find

func (i *ImageRefs) Find(ref string) (ImageRef, bool)

func (ImageRefs) ImageRefs

func (i ImageRefs) ImageRefs() []ImageRef

func (ImageRefs) ImagesLock

func (i ImageRefs) ImagesLock() lockconfig.ImagesLock

func (*ImageRefs) LocalizeToRepo

func (i *ImageRefs) LocalizeToRepo(relativeToRepo string)

func (*ImageRefs) MarkAsBundle

func (i *ImageRefs) MarkAsBundle(image string, isBundle bool)

func (*ImageRefs) UpdateRelativeToRepo

func (i *ImageRefs) UpdateRelativeToRepo(imgRetriever ImagesMetadata, relativeToRepo string) (bool, error)

type ImageType added in v0.26.0

type ImageType string

ImageType defines the type of Image. This is an evolving list that might grow with time

const (
	// BundleImage Image that represents a Bundle
	BundleImage ImageType = "Bundle"
	// ContentImage Image that is part of the Bundle
	ContentImage ImageType = "Image"
	// SignatureImage Image that contains a signature
	SignatureImage ImageType = "Signature"
	// InternalImage Image that contains a signature
	InternalImage ImageType = "Internal"
)

type ImagesLockReader

type ImagesLockReader interface {
	Read(img regv1.Image) (lockconfig.ImagesLock, error)
}

type ImagesMetadata

type ImagesMetadata interface {
	Get(regname.Reference) (*regremote.Descriptor, error)
	Image(regname.Reference) (regv1.Image, error)
	Digest(regname.Reference) (regv1.Hash, error)
	FirstImageExists(digests []string) (string, error)
}

type ImagesMetadataWriter

type ImagesMetadataWriter interface {
	ImagesMetadata
	WriteImage(regname.Reference, regv1.Image) error
	WriteTag(ref regname.Tag, taggagle regremote.Taggable) error
}

type InfoLog

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

func (InfoLog) Write

func (l InfoLog) Write(data []byte) (int, error)

type LocationImageReader

type LocationImageReader interface {
	Read(img regv1.Image) (ImageLocationsConfig, error)
}

type LocationsConfig

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

func (LocationsConfig) Config

type LocationsConfigs

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

func NewLocations

func NewLocations(ui util.UIWithLevels) *LocationsConfigs

NewLocations constructor for creating a LocationsConfigs

func NewLocationsWithReader

func NewLocationsWithReader(reader LocationImageReader, ui util.UIWithLevels) *LocationsConfigs

NewLocationsWithReader constructor for LocationsConfigs

func (*LocationsConfigs) Fetch

func (r *LocationsConfigs) Fetch(registry ImagesMetadata, bundleRef name.Digest) (ImageLocationsConfig, error)

Fetch Retrieve the ImageLocationsConfig for a particular Bundle

func (LocationsConfigs) LocationsImageDigest added in v0.26.0

func (r LocationsConfigs) LocationsImageDigest(registry ImagesMetadata, bundleRef name.Digest) (name.Digest, error)

LocationsImageDigest Retrieve the Locations OCI Image Digest

func (LocationsConfigs) Save

func (r LocationsConfigs) Save(reg ImagesMetadataWriter, bundleRef name.Digest, config ImageLocationsConfig, ui ui.UI) error

type LocationsNotFound

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

func (LocationsNotFound) Error

func (n LocationsNotFound) Error() string

type Logger added in v0.26.0

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

Logger Interface used for logging

type Metadata added in v0.26.0

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 NotFoundLocationsConfig added in v0.23.1

type NotFoundLocationsConfig struct{}

NotFoundLocationsConfig Noop Locations Configuration retrieval

func (NotFoundLocationsConfig) Config added in v0.23.1

Config Returns a LocationsNotFound error

type SignatureFetcher added in v0.26.0

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

SignatureFetcher Interface to retrieve signatures associated with Images

type Website added in v0.26.0

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

Website URL where more information of the Bundle can be found

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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