Documentation ¶
Overview ¶
Package imagelock implements utility routines for manipulating Images.lock files
Index ¶
- Constants
- func GetImageRemoteDescriptor(image string, opts ...crane.Option) (*remote.Descriptor, error)
- func Insecure(ic *Config)
- func WithAnnotationsKey(str string) func(ic *Config)
- func WithAuth(username, password string) func(ic *Config)
- func WithContext(ctx context.Context) func(ic *Config)
- func WithInsecure(insecure bool) func(ic *Config)
- func WithPlatforms(platforms []string) func(ic *Config)
- type Auth
- type ChartImage
- type Config
- type DigestInfo
- type ImageList
- type ImagesLock
- type Option
Constants ¶
const APIVersionV0 = "v0"
APIVersionV0 is the initial version of the API
const DefaultAnnotationsKey = "images"
DefaultAnnotationsKey is the default annotations key used to include the images metadata
const DefaultImagesLockFileName = "Images.lock"
DefaultImagesLockFileName is the default lock file name
Variables ¶
This section is empty.
Functions ¶
func GetImageRemoteDescriptor ¶
GetImageRemoteDescriptor returns the image descriptor
func Insecure ¶
func Insecure(ic *Config)
Insecure asks the tool to allow insecure HTTPS connections to the remote server.
func WithAnnotationsKey ¶
WithAnnotationsKey provides a custom annotation key to use when reading/writing the list of images
func WithAuth ¶ added in v0.4.0
WithAuth provides authentication information to access the container registry
func WithContext ¶
WithContext provides an execution context
func WithInsecure ¶
WithInsecure configures the InsecureMode of the Config
func WithPlatforms ¶
WithPlatforms configures the Platforms of the Config
Types ¶
type Auth ¶ added in v0.4.0
Auth defines the authentication information to access the container registry
type ChartImage ¶
type ChartImage struct { Name string // The name of the image. Image string // The image reference. Chart string // The chart containing the image. Digests []DigestInfo // List of image digests associated with the image. }
ChartImage represents an chart image with its associated information.
func (*ChartImage) Diff ¶
func (i *ChartImage) Diff(other *ChartImage) error
Diff returns an error if the Image is not equivalent to the provided one
func (*ChartImage) FetchDigests ¶
func (i *ChartImage) FetchDigests(cfg *Config) error
FetchDigests fetches the image digests for the image from upstream. It updates the Image's Digests field with the fetched digests. If an error occurs during the fetch, it returns the error.
func (*ChartImage) GetDigestForArch ¶
func (i *ChartImage) GetDigestForArch(arch string) (*DigestInfo, error)
GetDigestForArch returns the image digest for the specified architecture. It searches through the image's digests and returns the first digest that matches the given architecture. If no matching digest is found, it returns an error.
type Config ¶
type Config struct { InsecureMode bool AnnotationsKey string Context context.Context Auth Auth Platforms []string }
Config defines configuration options for ImageLock functions
func NewImagesLockConfig ¶
NewImagesLockConfig returns a new ImageLockConfig with default values
type DigestInfo ¶
type DigestInfo struct { Digest digest.Digest Arch string }
DigestInfo defines the digest information for an Architecture
type ImageList ¶
type ImageList []*ChartImage
ImageList defines a list of images
func GetImagesFromChartAnnotations ¶
GetImagesFromChartAnnotations reads the images annotation from the chart (if present) and returns a list of ChartImage
func (ImageList) ToAnnotation ¶
ToAnnotation returns the annotation text describing the list of named images, ready to be inserted in the Chart.yaml file
type ImagesLock ¶
type ImagesLock struct { APIVersion string `yaml:"apiVersion"` // The version of the API used for the lock file. Kind string // The type of object represented by the lock file. Metadata map[string]string // Additional metadata associated with the lock file. Chart struct { Name string // The name of the chart. Version string // The version of the chart. AppVersion string `yaml:"appVersion"` // The version of the app contained in the chart } // Information about the chart associated with the lock file. Images ImageList // List of included images }
ImagesLock represents the lock file containing information about the included images.
func FromYAML ¶
func FromYAML(r io.Reader) (*ImagesLock, error)
FromYAML reads a ImagesLock from the YAML read from r
func FromYAMLFile ¶
func FromYAMLFile(file string) (*ImagesLock, error)
FromYAMLFile reads a ImagesLock from the YAML file
func GenerateFromChart ¶
func GenerateFromChart(chartPath string, opts ...Option) (*ImagesLock, error)
GenerateFromChart creates a ImagesLock from the Chart at chartPath
func (*ImagesLock) FindImageByName ¶
func (il *ImagesLock) FindImageByName(chartName string, imageName string) (*ChartImage, error)
FindImageByName finds a included Image based on its name and containing chart
func (*ImagesLock) ToYAML ¶
func (il *ImagesLock) ToYAML(w io.Writer) error
ToYAML writes the serialized YAML representation of the ImagesLock to w
func (*ImagesLock) Validate ¶
func (il *ImagesLock) Validate(expectedImages ImageList) error
Validate checks if the provided list of images matches the contained set