image

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package image provides utilities to work with container images.

Index

Constants

View Source
const (
	// ContainerImageRegex is regular expression pattern to match container image usage in YAML
	// nolint:lll
	ContainerImageRegex = `` /* 149-byte string literal not displayed */

	// ReferenceType is the type of the reference
	ReferenceType = "container"
)

Variables

This section is empty.

Functions

func GetImageDigestFromRef

func GetImageDigestFromRef(ctx context.Context, imageRef, platform string, cache store.RefCacher) (*interfaces.EntityRef, error)

GetImageDigestFromRef returns the digest of a container image reference from a name.Reference.

Types

type Parser

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

Parser is a struct to replace container image references with digests

func New

func New() *Parser

New creates a new Parser

func (*Parser) ConvertToEntityRef

func (_ *Parser) ConvertToEntityRef(reference string) (*interfaces.EntityRef, error)

ConvertToEntityRef converts a container image reference to an EntityRef

func (*Parser) GetRegex

func (p *Parser) GetRegex() string

GetRegex returns the regular expression pattern to match container image usage

func (*Parser) Replace

func (p *Parser) Replace(
	ctx context.Context,
	matchedLine string,
	_ interfaces.REST,
	cfg config.Config,
) (*interfaces.EntityRef, error)

Replace replaces the container image reference with the digest

func (*Parser) SetCache

func (p *Parser) SetCache(cache store.RefCacher)

SetCache sets the cache to store the image references

func (*Parser) SetRegex

func (p *Parser) SetRegex(regex string)

SetRegex sets the regular expression pattern to match container image usage

Jump to

Keyboard shortcuts

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