Documentation ¶
Index ¶
- Constants
- func IsNotBundleError(err error) bool
- type Bundle
- func NewBundle(plainImg *plainimg.PlainImage, imagesMetadata ImagesMetadata, ...) *Bundle
- func NewBundleFromPlainImage(plainImg *plainimg.PlainImage, imagesMetadata ImagesMetadata) *Bundle
- func NewBundleFromRef(ref string, imagesMetadata ImagesMetadata, imagesLockReader ImagesLockReader, ...) *Bundle
- func (o *Bundle) AllImagesLockRefs(concurrency int, logger util.LoggerWithLevels) ([]*Bundle, ImageRefs, error)
- func (o *Bundle) Digest() string
- func (o *Bundle) DigestRef() string
- func (o *Bundle) FetchAllImagesRefs(concurrency int, ui Logger, sigFetcher SignatureFetcher) ([]*Bundle, error)
- func (o *Bundle) ImagesRefsWithErrors() []ImageRef
- func (o *Bundle) IsBundle() (bool, error)
- func (o *Bundle) NestedBundles() []GraphNode
- func (o *Bundle) NoteCopy(processedImages *imageset.ProcessedImages, reg ImagesMetadataWriter, ...) error
- func (o *Bundle) Pull(outputPath string, logger Logger, pullNestedBundles bool) (bool, error)
- func (o *Bundle) Repo() string
- func (o *Bundle) Tag() string
- type Contents
- type Fetcher
- type FetcherFromProcessedImages
- type GraphNode
- type ImageLocation
- type ImageLocationsConfig
- type ImageRef
- func NewBundleImageRef(imgRef lockconfig.ImageRef) ImageRef
- func NewContentImageRef(imgRef lockconfig.ImageRef) ImageRef
- func NewImageRefWithType(imgRef lockconfig.ImageRef, imageType ImageType) ImageRef
- func NewImageRefWithTypeAndError(imgRef lockconfig.ImageRef, imageType ImageType, err string) ImageRef
- type ImageRefLocationsConfig
- type ImageRefs
- func (i *ImageRefs) AddImagesRef(refs ...ImageRef)
- func (i *ImageRefs) Find(ref string) (ImageRef, bool)
- func (i ImageRefs) ImageRefs() []ImageRef
- func (i ImageRefs) ImagesLock() lockconfig.ImagesLock
- func (i *ImageRefs) LocalizeToRepo(relativeToRepo string)
- func (i *ImageRefs) MarkAsBundle(image string, isBundle bool)
- func (i *ImageRefs) UpdateRelativeToRepo(imgRetriever ImagesMetadata, relativeToRepo string) (bool, error)
- type ImageType
- type ImagesLockReader
- type ImagesMetadata
- type ImagesMetadataWriter
- type LocationImageReader
- type LocationsConfig
- type LocationsConfigs
- func (r *LocationsConfigs) Fetch(registry ImagesMetadata, bundleRef name.Digest) (ImageLocationsConfig, error)
- func (r LocationsConfigs) LocationsImageDigest(registry ImagesMetadata, bundleRef name.Digest) (name.Digest, error)
- func (r LocationsConfigs) Save(reg ImagesMetadataWriter, bundleRef name.Digest, config ImageLocationsConfig, ...) error
- type LocationsNotFound
- type Logger
- type NotFoundLocationsConfig
- type RegistryFetcher
- type SignatureFetcher
- type SingleLayerReader
Constants ¶
const ( ImgpkgDir = ".imgpkg" BundlesDir = "bundles" ImagesLockFile = "images.yml" )
const ( LocationFilepath = "image-locations.yml" ImageLocationsKind = "ImageLocations" LocationAPIVersion = "imgpkg.carvel.dev/v1alpha1" )
const (
BundleConfigLabel = "dev.carvel.imgpkg.bundle"
)
Variables ¶
This section is empty.
Functions ¶
func IsNotBundleError ¶
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
Bundle struct that represents a bundle
func NewBundle ¶
func NewBundle(plainImg *plainimg.PlainImage, imagesMetadata ImagesMetadata, imagesLockReader ImagesLockReader, bundleFetcher Fetcher) *Bundle
NewBundle Creates a new Bundle
func NewBundleFromPlainImage ¶
func NewBundleFromPlainImage(plainImg *plainimg.PlainImage, imagesMetadata ImagesMetadata) *Bundle
NewBundleFromPlainImage Creates a new Bundle with a PlainImage and uses Registry Fetcher
func NewBundleFromRef ¶ added in v0.37.0
func NewBundleFromRef(ref string, imagesMetadata ImagesMetadata, imagesLockReader ImagesLockReader, bundleFetcher Fetcher) *Bundle
NewBundleFromRef Creates a new Bundle from an image full reference
func (*Bundle) AllImagesLockRefs ¶ added in v0.26.0
func (o *Bundle) AllImagesLockRefs(concurrency int, logger util.LoggerWithLevels) ([]*Bundle, ImageRefs, error)
AllImagesLockRefs returns a flat list of nested bundles and every image reference for a specific bundle
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) ImagesRefsWithErrors ¶ added in v0.37.0
ImagesRefsWithErrors Retrieve the references for the Images of this particular bundle including images that imgpkg was not able to retrieve information for
func (*Bundle) NestedBundles ¶ added in v0.31.0
NestedBundles Provides information about the Graph of nested bundles associated with the current bundle
func (*Bundle) NoteCopy ¶
func (o *Bundle) NoteCopy(processedImages *imageset.ProcessedImages, reg ImagesMetadataWriter, ui util.LoggerWithLevels) error
NoteCopy writes an image-location representing the bundle / images that have been copied
type Contents ¶
type Contents struct {
// contains filtered or unexported fields
}
func NewContents ¶
NewContents creates Contents struct
func (Contents) PresentsAsBundle ¶
PresentsAsBundle checks if the provided folders have the needed structure to be a bundle
type Fetcher ¶ added in v0.37.0
type Fetcher interface { // Bundle search for the imgRef Digest // only returns the *Bundle if the current image is a bundle, if not the return value will be nil Bundle(throttleReq *util.Throttle, imgRef ImageRef) (lockconfig.ImageRef, *Bundle, error) }
Fetcher Interface that will fetch the bundle
type FetcherFromProcessedImages ¶ added in v0.37.0
type FetcherFromProcessedImages struct {
// contains filtered or unexported fields
}
FetcherFromProcessedImages struct that implements Fetcher and searches for the bundle in preprocessed images
func NewFetcherFromProcessedImages ¶ added in v0.37.0
func NewFetcherFromProcessedImages(processedImages []imageset.ProcessedImage, imgRetriever ImagesMetadata, imagesLockReader ImagesLockReader) *FetcherFromProcessedImages
NewFetcherFromProcessedImages Creates a bundle Fetcher that reads the information from previously processed images
func (*FetcherFromProcessedImages) Bundle ¶ added in v0.37.0
func (t *FetcherFromProcessedImages) Bundle(_ *util.Throttle, imgRef ImageRef) (lockconfig.ImageRef, *Bundle, error)
Bundle search for the imgRef Digest on the preprocessed images only returns the *Bundle if the current image is a bundle, if not the return value will be nil
type ImageLocation ¶
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 Error string }
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 NewImageRefWithTypeAndError ¶ added in v0.34.0
func NewImageRefWithTypeAndError(imgRef lockconfig.ImageRef, imageType ImageType, err string) ImageRef
NewImageRefWithTypeAndError Constructs a new ImageRef based on the ImageType that failed to fetch
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 (ImageRefs) ImagesLock ¶
func (i ImageRefs) ImagesLock() lockconfig.ImagesLock
func (*ImageRefs) LocalizeToRepo ¶
func (*ImageRefs) MarkAsBundle ¶
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 ImagesMetadataWriter ¶
type LocationImageReader ¶
type LocationImageReader interface {
Read(img regv1.Image) (ImageLocationsConfig, error)
}
type LocationsConfig ¶
type LocationsConfig struct {
// contains filtered or unexported fields
}
func (LocationsConfig) Config ¶
func (l LocationsConfig) Config() (ImageLocationsConfig, error)
type LocationsConfigs ¶
type LocationsConfigs struct {
// contains filtered or unexported fields
}
func NewLocations ¶
func NewLocations(ui util.LoggerWithLevels) *LocationsConfigs
NewLocations constructor for creating a LocationsConfigs
func NewLocationsWithReader ¶
func NewLocationsWithReader(reader LocationImageReader, ui util.LoggerWithLevels) *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, logger Logger) error
Save the locations information for the bundle in the registry This function will create an OCI Image that contains the Location information of all the images that are part of the Bundle
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{}) Logf(msg string, args ...interface{}) }
Logger Interface used for logging
type NotFoundLocationsConfig ¶ added in v0.23.1
type NotFoundLocationsConfig struct{}
NotFoundLocationsConfig Noop Locations Configuration retrieval
func (NotFoundLocationsConfig) Config ¶ added in v0.23.1
func (l NotFoundLocationsConfig) Config() (ImageLocationsConfig, error)
Config Returns a LocationsNotFound error
type RegistryFetcher ¶ added in v0.37.0
type RegistryFetcher struct {
// contains filtered or unexported fields
}
RegistryFetcher struct that implements Fetcher and searches for the bundle in the registry
func NewRegistryFetcher ¶ added in v0.37.0
func NewRegistryFetcher(imgRetriever ImagesMetadata, imagesLockReader ImagesLockReader) *RegistryFetcher
NewRegistryFetcher Creates a bundle Fetcher that talks to the registry
func (*RegistryFetcher) Bundle ¶ added in v0.37.0
func (r *RegistryFetcher) Bundle(throttleReq *util.Throttle, imgRef ImageRef) (lockconfig.ImageRef, *Bundle, error)
Bundle search for the imgRef Digest on the registry only returns the *Bundle if the current image is a bundle, if not the return value will be nil
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 SingleLayerReader ¶ added in v0.37.0
type SingleLayerReader struct {
// contains filtered or unexported fields
}
SingleLayerReader Reads the ImagesLock from an image and caches the result
func NewImagesLockReader ¶ added in v0.37.0
func NewImagesLockReader() *SingleLayerReader
NewImagesLockReader Creates a SingleLayerReader
func (*SingleLayerReader) Read ¶ added in v0.37.0
func (o *SingleLayerReader) Read(img regv1.Image) (lockconfig.ImagesLock, error)
Read the ImagesLock from the provided img